From c7d1ce7c9e688cc5aff9c2074ddb0e8ef4ea5525 Mon Sep 17 00:00:00 2001 From: theTibi Date: Tue, 14 Apr 2026 15:19:00 +0200 Subject: [PATCH 01/36] Add one-step PMM client installer script and UI integration - Introduced a new script `install-pmm-client.sh` for streamlined installation of the PMM client. - Updated Ansible tasks to copy the installer script to the appropriate directory. - Enhanced documentation with a new section for one-step installation from the UI. - Added a new Install Client page in the UI for generating installation commands. - Integrated navigation for the new Install Client page within the application. This update simplifies the PMM client installation process and improves user experience through the UI. --- .../roles/nginx/files/install-pmm-client.sh | 427 ++++++++++++++++++ build/ansible/roles/nginx/tasks/main.yml | 8 + .../install-pmm-client/one-step-ui-install.md | 54 +++ documentation/mkdocs-base.yml | 1 + .../navigation/navigation.constants.ts | 6 + .../install-client/InstallClientPage.tsx | 279 ++++++++++++ .../InstallClientPage.utils.test.ts | 78 ++++ .../install-client/InstallClientPage.utils.ts | 119 +++++ ui/apps/pmm/src/pages/install-client/index.ts | 1 + ui/apps/pmm/src/router.tsx | 5 + 10 files changed, 978 insertions(+) create mode 100644 build/ansible/roles/nginx/files/install-pmm-client.sh create mode 100644 documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md create mode 100644 ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx create mode 100644 ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts create mode 100644 ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts create mode 100644 ui/apps/pmm/src/pages/install-client/index.ts diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh new file mode 100644 index 00000000000..b959f1eeba3 --- /dev/null +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -0,0 +1,427 @@ +#!/usr/bin/env bash + +set -euo pipefail + +log() { + echo "[install-pmm-client] $*" +} + +error() { + echo "[install-pmm-client] ERROR: $*" >&2 + exit 1 +} + +usage() { + cat <<'EOF' +Usage: install-pmm-client.sh [options] + +Global options: + --pmm-server-url URL PMM server URL (supports service_token userinfo) + --pmm-server-insecure-tls Use --server-insecure-tls for pmm-admin config + --tech TECH One of: mysql, postgresql, mongodb, valkey + --node-name NAME Node name for pmm-admin register + --node-address ADDRESS Node address for pmm-admin register + --register-force Re-register node with --force + +Generic DB options (mapped per technology): + --db-user USER + --db-password PASSWORD + --db-host HOST + --db-port PORT + --db-name NAME DB name for PostgreSQL + --db-address HOST:PORT Explicit service address + --db-service-name NAME PMM service name + --db-auth-db NAME MongoDB auth database + --db-socket PATH Socket path for MySQL/PostgreSQL/MongoDB/Valkey + +Environment variables are also supported. +Priority is: flags > env vars > interactive prompt. +EOF +} + +PMM_SERVER_URL="${PMM_SERVER_URL:-}" +PMM_SERVER_INSECURE_TLS="${PMM_SERVER_INSECURE_TLS:-0}" +TECH="${TECH:-}" +NODE_NAME="${NODE_NAME:-}" +NODE_ADDRESS="${NODE_ADDRESS:-}" +PMM_REGISTER_FORCE="${PMM_REGISTER_FORCE:-0}" + +DB_USER="${DB_USER:-}" +DB_PASSWORD="${DB_PASSWORD:-}" +DB_HOST="${DB_HOST:-}" +DB_PORT="${DB_PORT:-}" +DB_NAME="${DB_NAME:-}" +DB_ADDRESS="${DB_ADDRESS:-}" +DB_SERVICE_NAME="${DB_SERVICE_NAME:-}" +DB_AUTH_DB="${DB_AUTH_DB:-}" +DB_SOCKET="${DB_SOCKET:-}" + +MYSQL_USERNAME="${MYSQL_USERNAME:-}" +MYSQL_PASSWORD="${MYSQL_PASSWORD:-}" +MYSQL_HOST="${MYSQL_HOST:-}" +MYSQL_PORT="${MYSQL_PORT:-}" +MYSQL_ADDRESS="${MYSQL_ADDRESS:-}" +MYSQL_SERVICE_NAME="${MYSQL_SERVICE_NAME:-}" +MYSQL_SOCKET="${MYSQL_SOCKET:-}" + +POSTGRESQL_USERNAME="${POSTGRESQL_USERNAME:-}" +POSTGRESQL_PASSWORD="${POSTGRESQL_PASSWORD:-}" +POSTGRESQL_HOST="${POSTGRESQL_HOST:-}" +POSTGRESQL_PORT="${POSTGRESQL_PORT:-}" +POSTGRESQL_ADDRESS="${POSTGRESQL_ADDRESS:-}" +POSTGRESQL_SERVICE_NAME="${POSTGRESQL_SERVICE_NAME:-}" +POSTGRESQL_DATABASE="${POSTGRESQL_DATABASE:-}" +POSTGRESQL_SOCKET="${POSTGRESQL_SOCKET:-}" + +MONGODB_USERNAME="${MONGODB_USERNAME:-}" +MONGODB_PASSWORD="${MONGODB_PASSWORD:-}" +MONGODB_HOST="${MONGODB_HOST:-}" +MONGODB_PORT="${MONGODB_PORT:-}" +MONGODB_ADDRESS="${MONGODB_ADDRESS:-}" +MONGODB_SERVICE_NAME="${MONGODB_SERVICE_NAME:-}" +MONGODB_AUTH_DB="${MONGODB_AUTH_DB:-}" +MONGODB_SOCKET="${MONGODB_SOCKET:-}" + +VALKEY_USERNAME="${VALKEY_USERNAME:-}" +VALKEY_PASSWORD="${VALKEY_PASSWORD:-}" +VALKEY_HOST="${VALKEY_HOST:-}" +VALKEY_PORT="${VALKEY_PORT:-}" +VALKEY_ADDRESS="${VALKEY_ADDRESS:-}" +VALKEY_SERVICE_NAME="${VALKEY_SERVICE_NAME:-}" +VALKEY_SOCKET="${VALKEY_SOCKET:-}" + +while [[ $# -gt 0 ]]; do + case "$1" in + --help|-h) + usage + exit 0 + ;; + --pmm-server-url) + PMM_SERVER_URL="${2:-}" + shift 2 + ;; + --pmm-server-insecure-tls) + PMM_SERVER_INSECURE_TLS=1 + shift + ;; + --tech) + TECH="${2:-}" + shift 2 + ;; + --node-name) + NODE_NAME="${2:-}" + shift 2 + ;; + --node-address) + NODE_ADDRESS="${2:-}" + shift 2 + ;; + --register-force) + PMM_REGISTER_FORCE=1 + shift + ;; + --db-user) + DB_USER="${2:-}" + shift 2 + ;; + --db-password) + DB_PASSWORD="${2:-}" + shift 2 + ;; + --db-host) + DB_HOST="${2:-}" + shift 2 + ;; + --db-port) + DB_PORT="${2:-}" + shift 2 + ;; + --db-name) + DB_NAME="${2:-}" + shift 2 + ;; + --db-address) + DB_ADDRESS="${2:-}" + shift 2 + ;; + --db-service-name) + DB_SERVICE_NAME="${2:-}" + shift 2 + ;; + --db-auth-db) + DB_AUTH_DB="${2:-}" + shift 2 + ;; + --db-socket) + DB_SOCKET="${2:-}" + shift 2 + ;; + *) + error "Unknown option: $1. Use --help for usage." + ;; + esac +done + +require_root() { + if [[ "${EUID}" -ne 0 ]]; then + error "Run this script as root (for package installation). Example: curl ... | sudo env ... bash" + fi +} + +prompt_if_empty() { + local var_name="$1" + local prompt_label="$2" + local secret="${3:-0}" + local value="${!var_name:-}" + + if [[ -n "${value}" ]]; then + return + fi + + if [[ "${secret}" == "1" ]]; then + read -r -s -p "${prompt_label}: " value + echo + else + read -r -p "${prompt_label}: " value + fi + + if [[ -z "${value}" ]]; then + error "${prompt_label} is required." + fi + + printf -v "${var_name}" '%s' "${value}" +} + +detect_os_family() { + if [[ -f /etc/redhat-release ]] || [[ -f /etc/centos-release ]]; then + echo "el" + return + fi + if [[ -f /etc/debian_version ]]; then + echo "debian" + return + fi + error "Unsupported OS. Supported families: RHEL/CentOS/Rocky/Oracle Linux and Debian/Ubuntu." +} + +install_percona_repo_el() { + if command -v percona-release >/dev/null 2>&1; then + return + fi + if command -v dnf >/dev/null 2>&1; then + dnf install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm + elif command -v yum >/dev/null 2>&1; then + yum install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm + else + error "Neither dnf nor yum was found." + fi +} + +install_percona_repo_debian() { + if command -v percona-release >/dev/null 2>&1; then + return + fi + apt-get update -y + apt-get install -y curl gnupg lsb-release + local deb_path="/tmp/percona-release_latest.generic_all.deb" + curl -fsSL -o "${deb_path}" "https://repo.percona.com/apt/percona-release_latest.generic_all.deb" + apt-get install -y "${deb_path}" + rm -f "${deb_path}" +} + +install_pmm_client() { + if command -v pmm-admin >/dev/null 2>&1; then + log "pmm-admin already installed; skipping package install." + return + fi + + local os_family + os_family="$(detect_os_family)" + log "Detected OS family: ${os_family}" + + if [[ "${os_family}" == "el" ]]; then + install_percona_repo_el + percona-release enable pmm3-client release || true + if command -v dnf >/dev/null 2>&1; then + dnf install -y pmm-client + else + yum install -y pmm-client + fi + return + fi + + install_percona_repo_debian + percona-release enable pmm3-client release || true + apt-get update -y + apt-get install -y pmm-client +} + +configure_pmm_agent() { + prompt_if_empty PMM_SERVER_URL "PMM server URL (example: https://service_token:GLSA_TOKEN@pmm.example.com:443)" 1 + prompt_if_empty TECH "Technology to add (mysql/postgresql/mongodb/valkey)" + + local config_cmd=(pmm-admin config "--server-url=${PMM_SERVER_URL}") + if [[ "${PMM_SERVER_INSECURE_TLS}" == "1" || "${PMM_SERVER_INSECURE_TLS}" == "true" ]]; then + config_cmd+=(--server-insecure-tls) + fi + if [[ -n "${NODE_ADDRESS}" ]]; then + config_cmd+=("${NODE_ADDRESS}") + fi + if [[ -n "${NODE_NAME}" ]]; then + config_cmd+=("generic" "${NODE_NAME}") + fi + + log "Running pmm-admin config..." + "${config_cmd[@]}" + + local register_cmd=(pmm-admin register) + if [[ -n "${NODE_ADDRESS}" ]]; then + register_cmd+=("${NODE_ADDRESS}") + fi + if [[ -n "${NODE_NAME}" ]]; then + register_cmd+=("generic" "${NODE_NAME}") + fi + if [[ "${PMM_REGISTER_FORCE}" == "1" || "${PMM_REGISTER_FORCE}" == "true" ]]; then + register_cmd+=(--force) + fi + + log "Running pmm-admin register..." + "${register_cmd[@]}" +} + +apply_generic_inputs() { + DB_USER="${DB_USER:-}" + DB_PASSWORD="${DB_PASSWORD:-}" + DB_HOST="${DB_HOST:-}" + DB_PORT="${DB_PORT:-}" + DB_ADDRESS="${DB_ADDRESS:-}" + DB_SERVICE_NAME="${DB_SERVICE_NAME:-}" + DB_AUTH_DB="${DB_AUTH_DB:-}" + DB_SOCKET="${DB_SOCKET:-}" + + MYSQL_USERNAME="${MYSQL_USERNAME:-${DB_USER}}" + MYSQL_PASSWORD="${MYSQL_PASSWORD:-${DB_PASSWORD}}" + MYSQL_HOST="${MYSQL_HOST:-${DB_HOST}}" + MYSQL_PORT="${MYSQL_PORT:-${DB_PORT}}" + MYSQL_ADDRESS="${MYSQL_ADDRESS:-${DB_ADDRESS}}" + MYSQL_SERVICE_NAME="${MYSQL_SERVICE_NAME:-${DB_SERVICE_NAME}}" + MYSQL_SOCKET="${MYSQL_SOCKET:-${DB_SOCKET}}" + + POSTGRESQL_USERNAME="${POSTGRESQL_USERNAME:-${DB_USER}}" + POSTGRESQL_PASSWORD="${POSTGRESQL_PASSWORD:-${DB_PASSWORD}}" + POSTGRESQL_HOST="${POSTGRESQL_HOST:-${DB_HOST}}" + POSTGRESQL_PORT="${POSTGRESQL_PORT:-${DB_PORT}}" + POSTGRESQL_ADDRESS="${POSTGRESQL_ADDRESS:-${DB_ADDRESS}}" + POSTGRESQL_SERVICE_NAME="${POSTGRESQL_SERVICE_NAME:-${DB_SERVICE_NAME}}" + POSTGRESQL_DATABASE="${POSTGRESQL_DATABASE:-${DB_NAME}}" + POSTGRESQL_SOCKET="${POSTGRESQL_SOCKET:-${DB_SOCKET}}" + + MONGODB_USERNAME="${MONGODB_USERNAME:-${DB_USER}}" + MONGODB_PASSWORD="${MONGODB_PASSWORD:-${DB_PASSWORD}}" + MONGODB_HOST="${MONGODB_HOST:-${DB_HOST}}" + MONGODB_PORT="${MONGODB_PORT:-${DB_PORT}}" + MONGODB_ADDRESS="${MONGODB_ADDRESS:-${DB_ADDRESS}}" + MONGODB_SERVICE_NAME="${MONGODB_SERVICE_NAME:-${DB_SERVICE_NAME}}" + MONGODB_AUTH_DB="${MONGODB_AUTH_DB:-${DB_AUTH_DB}}" + MONGODB_SOCKET="${MONGODB_SOCKET:-${DB_SOCKET}}" + + VALKEY_USERNAME="${VALKEY_USERNAME:-${DB_USER}}" + VALKEY_PASSWORD="${VALKEY_PASSWORD:-${DB_PASSWORD}}" + VALKEY_HOST="${VALKEY_HOST:-${DB_HOST}}" + VALKEY_PORT="${VALKEY_PORT:-${DB_PORT}}" + VALKEY_ADDRESS="${VALKEY_ADDRESS:-${DB_ADDRESS}}" + VALKEY_SERVICE_NAME="${VALKEY_SERVICE_NAME:-${DB_SERVICE_NAME}}" + VALKEY_SOCKET="${VALKEY_SOCKET:-${DB_SOCKET}}" +} + +add_mysql() { + prompt_if_empty MYSQL_USERNAME "MySQL username" + prompt_if_empty MYSQL_PASSWORD "MySQL password" 1 + MYSQL_ADDRESS="${MYSQL_ADDRESS:-${MYSQL_HOST:-127.0.0.1}:${MYSQL_PORT:-3306}}" + MYSQL_SERVICE_NAME="${MYSQL_SERVICE_NAME:-$(hostname)-mysql}" + local cmd=(pmm-admin add mysql "${MYSQL_SERVICE_NAME}" "${MYSQL_ADDRESS}" "--username=${MYSQL_USERNAME}" "--password=${MYSQL_PASSWORD}") + if [[ -n "${MYSQL_SOCKET}" ]]; then + cmd+=("--socket=${MYSQL_SOCKET}") + fi + log "Running pmm-admin add mysql..." + "${cmd[@]}" +} + +add_postgresql() { + prompt_if_empty POSTGRESQL_USERNAME "PostgreSQL username" + prompt_if_empty POSTGRESQL_PASSWORD "PostgreSQL password" 1 + POSTGRESQL_ADDRESS="${POSTGRESQL_ADDRESS:-${POSTGRESQL_HOST:-127.0.0.1}:${POSTGRESQL_PORT:-5432}}" + POSTGRESQL_SERVICE_NAME="${POSTGRESQL_SERVICE_NAME:-$(hostname)-postgresql}" + local cmd=(pmm-admin add postgresql "${POSTGRESQL_SERVICE_NAME}" "${POSTGRESQL_ADDRESS}" "--username=${POSTGRESQL_USERNAME}" "--password=${POSTGRESQL_PASSWORD}") + if [[ -n "${POSTGRESQL_DATABASE}" ]]; then + cmd+=("--database=${POSTGRESQL_DATABASE}") + fi + if [[ -n "${POSTGRESQL_SOCKET}" ]]; then + cmd+=("--socket=${POSTGRESQL_SOCKET}") + fi + log "Running pmm-admin add postgresql..." + "${cmd[@]}" +} + +add_mongodb() { + prompt_if_empty MONGODB_USERNAME "MongoDB username" + prompt_if_empty MONGODB_PASSWORD "MongoDB password" 1 + MONGODB_ADDRESS="${MONGODB_ADDRESS:-${MONGODB_HOST:-127.0.0.1}:${MONGODB_PORT:-27017}}" + MONGODB_SERVICE_NAME="${MONGODB_SERVICE_NAME:-$(hostname)-mongodb}" + local cmd=(pmm-admin add mongodb "${MONGODB_SERVICE_NAME}" "${MONGODB_ADDRESS}" "--username=${MONGODB_USERNAME}" "--password=${MONGODB_PASSWORD}") + if [[ -n "${MONGODB_AUTH_DB}" ]]; then + cmd+=("--authentication-database=${MONGODB_AUTH_DB}") + fi + if [[ -n "${MONGODB_SOCKET}" ]]; then + cmd+=("--socket=${MONGODB_SOCKET}") + fi + log "Running pmm-admin add mongodb..." + "${cmd[@]}" +} + +add_valkey() { + prompt_if_empty VALKEY_PASSWORD "Valkey password" 1 + VALKEY_ADDRESS="${VALKEY_ADDRESS:-${VALKEY_HOST:-127.0.0.1}:${VALKEY_PORT:-6379}}" + VALKEY_SERVICE_NAME="${VALKEY_SERVICE_NAME:-$(hostname)-valkey}" + local cmd=(pmm-admin add valkey "${VALKEY_SERVICE_NAME}" "${VALKEY_ADDRESS}" "--password=${VALKEY_PASSWORD}") + if [[ -n "${VALKEY_USERNAME}" ]]; then + cmd+=("--username=${VALKEY_USERNAME}") + fi + if [[ -n "${VALKEY_SOCKET}" ]]; then + cmd+=("--socket=${VALKEY_SOCKET}") + fi + log "Running pmm-admin add valkey..." + "${cmd[@]}" +} + +add_service() { + apply_generic_inputs + + case "${TECH}" in + mysql) + add_mysql + ;; + postgresql) + add_postgresql + ;; + mongodb) + add_mongodb + ;; + valkey) + add_valkey + ;; + *) + error "Unsupported TECH '${TECH}'. Supported values: mysql, postgresql, mongodb, valkey." + ;; + esac +} + +main() { + require_root + install_pmm_client + configure_pmm_agent + add_service + log "PMM client setup completed successfully." +} + +main "$@" diff --git a/build/ansible/roles/nginx/tasks/main.yml b/build/ansible/roles/nginx/tasks/main.yml index c7f49314afc..04cc0cb0467 100644 --- a/build/ansible/roles/nginx/tasks/main.yml +++ b/build/ansible/roles/nginx/tasks/main.yml @@ -88,3 +88,11 @@ group: root owner: pmm mode: 0644 + +- name: Copy one-step PMM client installer script + copy: + src: install-pmm-client.sh + dest: /usr/share/pmm-server/static/install-pmm-client.sh + group: root + owner: pmm + mode: 0755 diff --git a/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md b/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md new file mode 100644 index 00000000000..1af8c5dc2f3 --- /dev/null +++ b/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md @@ -0,0 +1,54 @@ +# One-step PMM Client install from UI + +Use the **Install PMM Client** wizard to generate a single command that installs `pmm-client`, registers the node, and adds one monitored service. + +## Before you start + +- PMM Server must be reachable from the target node on `443`. +- The node user running the command needs `sudo` access. +- You need a PMM token that works with `pmm-admin config --server-url`, for example: + - `https://service_token:GLSA_...@:443` + +## Generate the command + +1. In PMM UI, open **Inventory** -> **Install PMM Client**. +2. Choose technology: `MySQL`, `PostgreSQL`, `MongoDB`, or `Valkey`. +3. Select credentials mode: + - **Prompt on node (recommended)**: password is typed interactively on the node. + - **Include env variables**: password is passed through environment variables. + - **Pass as script flags**: password is passed as script arguments. +4. Paste your service token and adjust optional fields (node name/address, DB host/port, service name). +5. Copy the generated command and run it on the target node. + +Example (env mode): + +```bash +curl -fsSL "https:///pmm-static/install-pmm-client.sh" | sudo env \ + PMM_SERVER_URL='https://service_token:@:443' \ + PMM_SERVER_INSECURE_TLS=1 \ + TECH=mysql \ + DB_USER='pmm' \ + DB_PASSWORD='secret' \ + bash +``` + +## What the script does + +The script available at `/pmm-static/install-pmm-client.sh` performs: + +1. Install `pmm-client` using the OS package manager (RHEL-compatible or Debian-compatible hosts). +2. Run `pmm-admin config` against your PMM server. +3. Run `pmm-admin register`. +4. Run `pmm-admin add ` using your selected options. + +## Security notes + +- Prefer **Prompt on node** for production to avoid exposing DB passwords in shell history and process lists. +- If you use env or flags modes, clean shell history and avoid sharing terminal logs. +- The generated command is created in the browser; secrets are not written into a static script on PMM Server. + +## Troubleshooting + +- If TLS is self-signed, enable `PMM_SERVER_INSECURE_TLS`. +- If package install fails, verify outbound access to Percona repositories. +- If registration fails for existing nodes, enable force re-registration (`PMM_REGISTER_FORCE=1` / `--register-force`). diff --git a/documentation/mkdocs-base.yml b/documentation/mkdocs-base.yml index a9dd381d7f6..751718ba545 100644 --- a/documentation/mkdocs-base.yml +++ b/documentation/mkdocs-base.yml @@ -193,6 +193,7 @@ nav: - Install PMM Client: - Client installation overview: install-pmm/install-pmm-client/index.md - install-pmm/install-pmm-client/prerequisites.md + - One-step install from UI: install-pmm/install-pmm-client/one-step-ui-install.md - Deployment options: - Install with Package Manager: install-pmm/install-pmm-client/package_manager.md - Install from binaries: install-pmm/install-pmm-client/binary_package.md diff --git a/ui/apps/pmm/src/contexts/navigation/navigation.constants.ts b/ui/apps/pmm/src/contexts/navigation/navigation.constants.ts index 5480fc056ba..b1ad5a00717 100644 --- a/ui/apps/pmm/src/contexts/navigation/navigation.constants.ts +++ b/ui/apps/pmm/src/contexts/navigation/navigation.constants.ts @@ -573,6 +573,12 @@ export const NAV_INVENTORY: NavItem = { url: `${PMM_NEW_NAV_GRAFANA_PATH}/inventory/nodes`, matches: ['*'], }, + { + id: 'install-pmm-client', + text: 'Install PMM Client', + url: `${PMM_NEW_NAV_PATH}/install-client`, + matches: ['*'], + }, ], }; diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx new file mode 100644 index 00000000000..90f178eaeb4 --- /dev/null +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -0,0 +1,279 @@ +import { useMemo, useState } from 'react'; +import { + Alert, + Box, + Button, + Card, + CardContent, + FormControl, + FormControlLabel, + InputLabel, + MenuItem, + Select, + Stack, + Switch, + TextField, + Typography, +} from '@mui/material'; +import { Page } from 'components/page'; +import { + buildInstallCommand, + CredentialsMode, + Technology, +} from './InstallClientPage.utils'; + +export const InstallClientPage = () => { + const [technology, setTechnology] = useState('mysql'); + const [credentialsMode, setCredentialsMode] = useState('prompt'); + const [token, setToken] = useState(''); + const [pmmHost, setPmmHost] = useState(() => window.location.host); + const [insecureTLS, setInsecureTLS] = useState(false); + const [registerForce, setRegisterForce] = useState(false); + const [nodeName, setNodeName] = useState(''); + const [nodeAddress, setNodeAddress] = useState(''); + const [dbUser, setDbUser] = useState(''); + const [dbPassword, setDbPassword] = useState(''); + const [dbHost, setDbHost] = useState(''); + const [dbPort, setDbPort] = useState(''); + const [dbName, setDbName] = useState(''); + const [dbAuthDB, setDbAuthDB] = useState(''); + const [dbServiceName, setDbServiceName] = useState(''); + const [copied, setCopied] = useState(false); + + const installerUrl = useMemo( + () => `${window.location.origin}/pmm-static/install-pmm-client.sh`, + [] + ); + + const serverURL = useMemo(() => { + if (!token.trim()) { + return `https://service_token:@${pmmHost || ''}:443`; + } + return `https://service_token:${token.trim()}@${pmmHost || 'localhost'}:443`; + }, [token, pmmHost]); + + const command = useMemo( + () => + buildInstallCommand({ + installerUrl, + technology, + credentialsMode, + serverURL, + insecureTLS, + registerForce, + nodeName, + nodeAddress, + dbUser, + dbPassword, + dbHost, + dbPort, + dbName, + dbAuthDB, + dbServiceName, + }), + [ + credentialsMode, + dbAuthDB, + dbHost, + dbName, + dbPassword, + dbPort, + dbServiceName, + dbUser, + insecureTLS, + installerUrl, + nodeAddress, + nodeName, + registerForce, + serverURL, + technology, + ] + ); + + const handleCopy = async () => { + await navigator.clipboard.writeText(command); + setCopied(true); + window.setTimeout(() => setCopied(false), 2000); + }; + + return ( + + + + + + Choose installation options, then copy and run the generated command + on your database node. + + + + Technology + + + + + Credentials mode + + + + + + + setPmmHost(e.target.value)} + helperText="Used to build PMM_SERVER_URL" + /> + setToken(e.target.value)} + helperText="Used only to render command locally in browser" + /> + + + + setNodeName(e.target.value)} + /> + setNodeAddress(e.target.value)} + /> + + + + setDbUser(e.target.value)} + /> + setDbPassword(e.target.value)} + /> + + + + setDbHost(e.target.value)} + /> + setDbPort(e.target.value)} + /> + setDbServiceName(e.target.value)} + /> + + + {technology === 'postgresql' && ( + setDbName(e.target.value)} + /> + )} + {technology === 'mongodb' && ( + setDbAuthDB(e.target.value)} + /> + )} + + + setInsecureTLS(e.target.checked)} + /> + } + label="Use insecure TLS" + /> + setRegisterForce(e.target.checked)} + /> + } + label="Force re-register node" + /> + + + + + + + + + Generated command + + + + + {copied && Command copied.} + + Passwords in command-line args or env vars may be visible in shell + history. Use prompt mode when possible. + + + + + + ); +}; diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts new file mode 100644 index 00000000000..be7657a7462 --- /dev/null +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts @@ -0,0 +1,78 @@ +import { describe, expect, test } from 'vitest'; +import { buildInstallCommand, InstallCommandOptions } from './InstallClientPage.utils'; + +const baseOptions: InstallCommandOptions = { + installerUrl: 'https://pmm.example.com/pmm-static/install-pmm-client.sh', + technology: 'mysql', + credentialsMode: 'prompt', + serverURL: 'https://service_token:GLSA@pmm.example.com:443', + insecureTLS: false, + registerForce: false, + nodeName: '', + nodeAddress: '', + dbUser: 'pmm', + dbPassword: 'secret', + dbHost: '127.0.0.1', + dbPort: '3306', + dbName: '', + dbAuthDB: '', + dbServiceName: 'node-mysql', +}; + +describe('buildInstallCommand', () => { + test('omits DB password in prompt mode', () => { + const cmd = buildInstallCommand(baseOptions); + expect(cmd).toContain("TECH='mysql'"); + expect(cmd).not.toContain('DB_PASSWORD='); + expect(cmd).toContain('sudo env'); + }); + + test('includes DB credentials in env mode', () => { + const cmd = buildInstallCommand({ + ...baseOptions, + credentialsMode: 'env', + }); + expect(cmd).toContain("DB_USER='pmm'"); + expect(cmd).toContain("DB_PASSWORD='secret'"); + expect(cmd).toContain("DB_HOST='127.0.0.1'"); + }); + + test('uses flags mode and includes db args', () => { + const cmd = buildInstallCommand({ + ...baseOptions, + credentialsMode: 'flags', + technology: 'postgresql', + dbName: 'postgres', + }); + expect(cmd).toContain('sudo bash -s --'); + expect(cmd).toContain("--tech 'postgresql'"); + expect(cmd).toContain("--db-password 'secret'"); + expect(cmd).toContain("--db-name 'postgres'"); + }); + + test('includes mongodb auth db only for mongodb', () => { + const mongodb = buildInstallCommand({ + ...baseOptions, + credentialsMode: 'env', + technology: 'mongodb', + dbAuthDB: 'admin', + }); + const mysql = buildInstallCommand({ + ...baseOptions, + credentialsMode: 'env', + technology: 'mysql', + dbAuthDB: 'admin', + }); + + expect(mongodb).toContain("DB_AUTH_DB='admin'"); + expect(mysql).not.toContain('DB_AUTH_DB='); + }); + + test('supports valkey technology', () => { + const cmd = buildInstallCommand({ + ...baseOptions, + technology: 'valkey', + }); + expect(cmd).toContain("TECH='valkey'"); + }); +}); diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts new file mode 100644 index 00000000000..1294ee12743 --- /dev/null +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts @@ -0,0 +1,119 @@ +export type Technology = 'mysql' | 'postgresql' | 'mongodb' | 'valkey'; +export type CredentialsMode = 'prompt' | 'env' | 'flags'; + +export interface InstallCommandOptions { + installerUrl: string; + technology: Technology; + credentialsMode: CredentialsMode; + serverURL: string; + insecureTLS: boolean; + registerForce: boolean; + nodeName: string; + nodeAddress: string; + dbUser: string; + dbPassword: string; + dbHost: string; + dbPort: string; + dbName: string; + dbAuthDB: string; + dbServiceName: string; +} + +export const shellEscape = (value: string): string => + `'${value.replace(/'/g, `'\\''`)}'`; + +export const buildInstallCommand = (opts: InstallCommandOptions): string => { + const envVars: string[] = [ + `PMM_SERVER_URL=${shellEscape(opts.serverURL)}`, + `TECH=${shellEscape(opts.technology)}`, + ]; + + if (opts.insecureTLS) { + envVars.push('PMM_SERVER_INSECURE_TLS=1'); + } + if (opts.registerForce) { + envVars.push('PMM_REGISTER_FORCE=1'); + } + if (opts.nodeName.trim()) { + envVars.push(`NODE_NAME=${shellEscape(opts.nodeName.trim())}`); + } + if (opts.nodeAddress.trim()) { + envVars.push(`NODE_ADDRESS=${shellEscape(opts.nodeAddress.trim())}`); + } + + if (opts.credentialsMode === 'env') { + if (opts.dbUser.trim()) { + envVars.push(`DB_USER=${shellEscape(opts.dbUser.trim())}`); + } + if (opts.dbPassword.trim()) { + envVars.push(`DB_PASSWORD=${shellEscape(opts.dbPassword.trim())}`); + } + if (opts.dbHost.trim()) { + envVars.push(`DB_HOST=${shellEscape(opts.dbHost.trim())}`); + } + if (opts.dbPort.trim()) { + envVars.push(`DB_PORT=${shellEscape(opts.dbPort.trim())}`); + } + if (opts.dbServiceName.trim()) { + envVars.push(`DB_SERVICE_NAME=${shellEscape(opts.dbServiceName.trim())}`); + } + if (opts.dbName.trim() && opts.technology === 'postgresql') { + envVars.push(`DB_NAME=${shellEscape(opts.dbName.trim())}`); + } + if (opts.dbAuthDB.trim() && opts.technology === 'mongodb') { + envVars.push(`DB_AUTH_DB=${shellEscape(opts.dbAuthDB.trim())}`); + } + } + + if (opts.credentialsMode === 'flags') { + const flags: string[] = [`--tech ${shellEscape(opts.technology)}`]; + + if (opts.nodeName.trim()) { + flags.push(`--node-name ${shellEscape(opts.nodeName.trim())}`); + } + if (opts.nodeAddress.trim()) { + flags.push(`--node-address ${shellEscape(opts.nodeAddress.trim())}`); + } + if (opts.insecureTLS) { + flags.push('--pmm-server-insecure-tls'); + } + if (opts.registerForce) { + flags.push('--register-force'); + } + if (opts.dbUser.trim()) { + flags.push(`--db-user ${shellEscape(opts.dbUser.trim())}`); + } + if (opts.dbPassword.trim()) { + flags.push(`--db-password ${shellEscape(opts.dbPassword.trim())}`); + } + if (opts.dbHost.trim()) { + flags.push(`--db-host ${shellEscape(opts.dbHost.trim())}`); + } + if (opts.dbPort.trim()) { + flags.push(`--db-port ${shellEscape(opts.dbPort.trim())}`); + } + if (opts.dbServiceName.trim()) { + flags.push(`--db-service-name ${shellEscape(opts.dbServiceName.trim())}`); + } + if (opts.dbName.trim() && opts.technology === 'postgresql') { + flags.push(`--db-name ${shellEscape(opts.dbName.trim())}`); + } + if (opts.dbAuthDB.trim() && opts.technology === 'mongodb') { + flags.push(`--db-auth-db ${shellEscape(opts.dbAuthDB.trim())}`); + } + + return [ + `curl -fsSL ${shellEscape(opts.installerUrl)} | sudo bash -s -- \\`, + ` --pmm-server-url ${shellEscape(opts.serverURL)} \\`, + ` ${flags.join(' \\\n ')}`, + ].join('\n'); + } + + return [ + `curl -fsSL ${shellEscape(opts.installerUrl)} | sudo env \\`, + ...envVars.map((item, index) => { + const suffix = index === envVars.length - 1 ? ' bash' : ' \\'; + return ` ${item}${suffix}`; + }), + ].join('\n'); +}; diff --git a/ui/apps/pmm/src/pages/install-client/index.ts b/ui/apps/pmm/src/pages/install-client/index.ts new file mode 100644 index 00000000000..a1783cf07d6 --- /dev/null +++ b/ui/apps/pmm/src/pages/install-client/index.ts @@ -0,0 +1 @@ +export * from './InstallClientPage'; diff --git a/ui/apps/pmm/src/router.tsx b/ui/apps/pmm/src/router.tsx index 1565d6ead58..cd4f95b7a36 100644 --- a/ui/apps/pmm/src/router.tsx +++ b/ui/apps/pmm/src/router.tsx @@ -12,6 +12,7 @@ import { RealtimeSessionsPage } from 'pages/rta/sessions'; import { Redirect } from 'components/redirect'; import RealtimeOverviewPage from 'pages/rta/overview/RealtimeOverview'; import RealtimeTab from 'pages/rta/tab/RealtimeTab'; +import { InstallClientPage } from 'pages/install-client'; const router = createBrowserRouter( [ @@ -39,6 +40,10 @@ const router = createBrowserRouter( path: 'help', element: , }, + { + path: 'install-client', + element: , + }, { path: 'rta', children: [ From 20d0717f77026ec5a362246aec6abd52307159bb Mon Sep 17 00:00:00 2001 From: theTibi Date: Tue, 14 Apr 2026 23:03:36 +0200 Subject: [PATCH 02/36] Refactor access control and actions API files - Cleaned up import statements in `accesscontrol_grpc.pb.go` and `actions_grpc.pb.go` by removing unnecessary blank lines. - Updated `accesscontrol.pb.go` and `actions.pb.go` to reorder import statements for consistency. - Added validation checks in `accesscontrol.pb.validate.go` and `advisors.pb.validate.go` to ensure proper handling of optional fields. - Introduced new Swagger JSON files for `accesscontrol` and `actions` APIs to enhance API documentation. - Improved formatting and organization of code across multiple files for better readability and maintainability. These changes enhance the overall structure and documentation of the API, making it easier for developers to understand and use. --- api-tests/management/nodes_test.go | 16 + api/accesscontrol/v1beta1/accesscontrol.pb.go | 46 +- .../v1beta1/accesscontrol.pb.validate.go | 2 + .../v1beta1/accesscontrol.swagger.json | 410 ++ .../v1beta1/accesscontrol_grpc.pb.go | 7 - api/actions/v1/actions.pb.go | 84 +- api/actions/v1/actions.swagger.json | 737 +++ api/actions/v1/actions_grpc.pb.go | 4 - api/advisors/v1/advisors.pb.go | 67 +- api/advisors/v1/advisors.pb.validate.go | 4 + api/advisors/v1/advisors.swagger.json | 539 ++ api/advisors/v1/advisors_grpc.pb.go | 6 - api/agent/pb/agent.pb.go | 9 +- api/agent/pb/agent.swagger.json | 55 + api/agent/pb/agent_grpc.pb.go | 4 +- api/agent/v1/agent.pb.go | 233 +- api/agent/v1/agent.pb.validate.go | 1 + api/agent/v1/agent.swagger.json | 55 + api/agent/v1/agent_grpc.pb.go | 1 - api/agent/v1/collector.pb.go | 39 +- api/agent/v1/collector.swagger.json | 50 + api/agentlocal/v1/agentlocal.pb.go | 39 +- api/agentlocal/v1/agentlocal.swagger.json | 295 + api/agentlocal/v1/agentlocal_grpc.pb.go | 2 - api/alerting/v1/alerting.pb.go | 75 +- api/alerting/v1/alerting.pb.validate.go | 4 + api/alerting/v1/alerting.swagger.json | 581 ++ api/alerting/v1/alerting_grpc.pb.go | 5 - api/alerting/v1/params.pb.go | 18 +- api/alerting/v1/params.swagger.json | 44 + api/backup/v1/artifacts.pb.go | 44 +- api/backup/v1/artifacts.swagger.json | 44 + api/backup/v1/backup.pb.go | 75 +- api/backup/v1/backup.swagger.json | 1003 ++++ api/backup/v1/backup_grpc.pb.go | 10 - api/backup/v1/common.pb.go | 32 +- api/backup/v1/common.swagger.json | 44 + api/backup/v1/errors.pb.go | 20 +- api/backup/v1/errors.swagger.json | 44 + api/backup/v1/locations.pb.go | 42 +- api/backup/v1/locations.swagger.json | 353 ++ api/backup/v1/locations_grpc.pb.go | 5 - api/backup/v1/restores.pb.go | 40 +- api/backup/v1/restores.swagger.json | 303 + api/backup/v1/restores_grpc.pb.go | 3 - api/common/common.pb.go | 20 +- api/common/common.swagger.json | 44 + api/common/metrics_resolutions.pb.go | 20 +- api/common/metrics_resolutions.swagger.json | 44 + api/dump/v1beta1/dump.pb.go | 48 +- api/dump/v1beta1/dump.swagger.json | 383 ++ api/dump/v1beta1/dump_grpc.pb.go | 5 - api/ha/v1beta1/ha.pb.go | 30 +- api/ha/v1beta1/ha.swagger.json | 148 + api/ha/v1beta1/ha_grpc.pb.go | 2 - api/inventory/v1/agent_status.pb.go | 16 +- api/inventory/v1/agent_status.swagger.json | 44 + api/inventory/v1/agents.pb.go | 247 +- api/inventory/v1/agents.pb.validate.go | 38 + api/inventory/v1/agents.swagger.json | 4430 +++++++++++++++ api/inventory/v1/agents_grpc.pb.go | 6 - api/inventory/v1/log_level.pb.go | 16 +- api/inventory/v1/log_level.swagger.json | 44 + api/inventory/v1/nodes.pb.go | 76 +- api/inventory/v1/nodes.swagger.json | 708 +++ api/inventory/v1/nodes_grpc.pb.go | 4 - api/inventory/v1/services.pb.go | 109 +- api/inventory/v1/services.pb.validate.go | 2 + api/inventory/v1/services.swagger.json | 1189 ++++ api/inventory/v1/services_grpc.pb.go | 6 - api/management/v1/agent.pb.go | 55 +- api/management/v1/agent.swagger.json | 44 + api/management/v1/annotation.pb.go | 20 +- api/management/v1/annotation.swagger.json | 44 + api/management/v1/azure.pb.go | 32 +- api/management/v1/azure.swagger.json | 44 + api/management/v1/external.pb.go | 33 +- api/management/v1/external.swagger.json | 44 + api/management/v1/haproxy.pb.go | 33 +- api/management/v1/haproxy.swagger.json | 44 + .../add_annotation_parameters.go | 2 + .../add_annotation_responses.go | 43 +- .../add_azure_database_parameters.go | 2 + .../add_azure_database_responses.go | 45 +- .../add_service_parameters.go | 2 + .../add_service_responses.go | 4512 +++++++-------- .../create_node_install_token_parameters.go | 149 + .../create_node_install_token_responses.go | 524 ++ .../discover_azure_database_parameters.go | 2 + .../discover_azure_database_responses.go | 76 +- .../discover_rds_parameters.go | 2 + .../discover_rds_responses.go | 68 +- .../management_service/get_node_parameters.go | 2 + .../management_service/get_node_responses.go | 217 +- .../list_agent_versions_parameters.go | 1 + .../list_agent_versions_responses.go | 61 +- .../list_agents_parameters.go | 4 + .../list_agents_responses.go | 233 +- .../list_nodes_parameters.go | 7 +- .../list_nodes_responses.go | 219 +- .../list_services_parameters.go | 9 +- .../list_services_responses.go | 261 +- .../management_service_client.go | 182 +- .../register_node_parameters.go | 2 + .../register_node_responses.go | 192 +- .../remove_service_parameters.go | 7 +- .../remove_service_responses.go | 42 +- .../unregister_node_parameters.go | 3 + .../unregister_node_responses.go | 39 +- api/management/v1/json/v1.json | 4920 ++++++++--------- api/management/v1/metrics.pb.go | 16 +- api/management/v1/metrics.swagger.json | 44 + api/management/v1/mongodb.pb.go | 41 +- api/management/v1/mongodb.swagger.json | 44 + api/management/v1/mysql.pb.go | 41 +- api/management/v1/mysql.swagger.json | 44 + api/management/v1/node.pb.go | 248 +- api/management/v1/node.pb.validate.go | 243 + api/management/v1/node.proto | 18 + api/management/v1/node.swagger.json | 44 + api/management/v1/postgresql.pb.go | 39 +- api/management/v1/postgresql.swagger.json | 44 + api/management/v1/proxysql.pb.go | 35 +- api/management/v1/proxysql.swagger.json | 44 + api/management/v1/rds.pb.go | 53 +- api/management/v1/rds.swagger.json | 44 + api/management/v1/service.pb.go | 168 +- api/management/v1/service.pb.gw.go | 118 +- api/management/v1/service.proto | 11 + api/management/v1/service.swagger.json | 4565 +++++++++++++++ api/management/v1/service_grpc.pb.go | 79 +- api/management/v1/severity.pb.go | 16 +- api/management/v1/severity.swagger.json | 44 + api/management/v1/valkey.pb.go | 35 +- api/management/v1/valkey.pb.validate.go | 4 + api/management/v1/valkey.swagger.json | 44 + api/qan/v1/collector.pb.go | 35 +- api/qan/v1/collector.swagger.json | 44 + api/qan/v1/collector_grpc.pb.go | 1 - api/qan/v1/filters.pb.go | 30 +- api/qan/v1/filters.swagger.json | 44 + api/qan/v1/object_details.pb.go | 76 +- api/qan/v1/object_details.swagger.json | 44 + api/qan/v1/profile.pb.go | 34 +- api/qan/v1/profile.swagger.json | 44 + api/qan/v1/qan.pb.go | 22 +- api/qan/v1/qan.swagger.json | 44 + api/qan/v1/service.pb.go | 66 +- api/qan/v1/service.swagger.json | 1568 ++++++ api/qan/v1/service_grpc.pb.go | 12 - api/realtimeanalytics/v1/collector.pb.go | 22 +- .../v1/collector.swagger.json | 44 + api/realtimeanalytics/v1/collector_grpc.pb.go | 1 - api/realtimeanalytics/v1/query.pb.go | 24 +- api/realtimeanalytics/v1/query.swagger.json | 44 + .../v1/realtimeanalytics.pb.go | 55 +- .../v1/realtimeanalytics.swagger.json | 516 ++ .../v1/realtimeanalytics_grpc.pb.go | 6 - api/server/v1/httperror.pb.go | 20 +- api/server/v1/httperror.swagger.json | 46 + api/server/v1/server.pb.go | 81 +- api/server/v1/server.pb.validate.go | 2 + api/server/v1/server.swagger.json | 798 +++ api/server/v1/server_grpc.pb.go | 10 - api/uievents/v1/server.pb.go | 30 +- api/uievents/v1/server.pb.gw.go | 8 +- api/uievents/v1/server.swagger.json | 202 + api/uievents/v1/server_grpc.pb.go | 1 - api/user/v1/user.pb.go | 32 +- api/user/v1/user.swagger.json | 243 + api/user/v1/user_grpc.pb.go | 3 - build/ansible/pmm-docker/post-build.yml | 22 + managed/services/grafana/auth_server_test.go | 1 + managed/services/grafana/client.go | 70 +- managed/services/management/deps.go | 1 + managed/services/management/install_token.go | 76 + .../services/management/install_token_test.go | 88 + .../management/mock_grafana_client_test.go | 25 + ui/apps/pmm/src/api/installToken.ts | 23 + ui/apps/pmm/src/api/managementEndpoints.ts | 2 + .../install-client/InstallClientPage.tsx | 46 +- .../InstallClientPage.utils.test.ts | 20 +- .../install-client/InstallClientPage.utils.ts | 15 + 183 files changed, 28690 insertions(+), 7471 deletions(-) create mode 100644 api/accesscontrol/v1beta1/accesscontrol.swagger.json create mode 100644 api/actions/v1/actions.swagger.json create mode 100644 api/advisors/v1/advisors.swagger.json create mode 100644 api/agent/pb/agent.swagger.json create mode 100644 api/agent/v1/agent.swagger.json create mode 100644 api/agent/v1/collector.swagger.json create mode 100644 api/agentlocal/v1/agentlocal.swagger.json create mode 100644 api/alerting/v1/alerting.swagger.json create mode 100644 api/alerting/v1/params.swagger.json create mode 100644 api/backup/v1/artifacts.swagger.json create mode 100644 api/backup/v1/backup.swagger.json create mode 100644 api/backup/v1/common.swagger.json create mode 100644 api/backup/v1/errors.swagger.json create mode 100644 api/backup/v1/locations.swagger.json create mode 100644 api/backup/v1/restores.swagger.json create mode 100644 api/common/common.swagger.json create mode 100644 api/common/metrics_resolutions.swagger.json create mode 100644 api/dump/v1beta1/dump.swagger.json create mode 100644 api/ha/v1beta1/ha.swagger.json create mode 100644 api/inventory/v1/agent_status.swagger.json create mode 100644 api/inventory/v1/agents.swagger.json create mode 100644 api/inventory/v1/log_level.swagger.json create mode 100644 api/inventory/v1/nodes.swagger.json create mode 100644 api/inventory/v1/services.swagger.json create mode 100644 api/management/v1/agent.swagger.json create mode 100644 api/management/v1/annotation.swagger.json create mode 100644 api/management/v1/azure.swagger.json create mode 100644 api/management/v1/external.swagger.json create mode 100644 api/management/v1/haproxy.swagger.json create mode 100644 api/management/v1/json/client/management_service/create_node_install_token_parameters.go create mode 100644 api/management/v1/json/client/management_service/create_node_install_token_responses.go create mode 100644 api/management/v1/metrics.swagger.json create mode 100644 api/management/v1/mongodb.swagger.json create mode 100644 api/management/v1/mysql.swagger.json create mode 100644 api/management/v1/node.swagger.json create mode 100644 api/management/v1/postgresql.swagger.json create mode 100644 api/management/v1/proxysql.swagger.json create mode 100644 api/management/v1/rds.swagger.json create mode 100644 api/management/v1/service.swagger.json create mode 100644 api/management/v1/severity.swagger.json create mode 100644 api/management/v1/valkey.swagger.json create mode 100644 api/qan/v1/collector.swagger.json create mode 100644 api/qan/v1/filters.swagger.json create mode 100644 api/qan/v1/object_details.swagger.json create mode 100644 api/qan/v1/profile.swagger.json create mode 100644 api/qan/v1/qan.swagger.json create mode 100644 api/qan/v1/service.swagger.json create mode 100644 api/realtimeanalytics/v1/collector.swagger.json create mode 100644 api/realtimeanalytics/v1/query.swagger.json create mode 100644 api/realtimeanalytics/v1/realtimeanalytics.swagger.json create mode 100644 api/server/v1/httperror.swagger.json create mode 100644 api/server/v1/server.swagger.json create mode 100644 api/uievents/v1/server.swagger.json create mode 100644 api/user/v1/user.swagger.json create mode 100644 managed/services/management/install_token.go create mode 100644 managed/services/management/install_token_test.go create mode 100644 ui/apps/pmm/src/api/installToken.ts create mode 100644 ui/apps/pmm/src/api/managementEndpoints.ts diff --git a/api-tests/management/nodes_test.go b/api-tests/management/nodes_test.go index 403eaeaaf77..80f387bde5d 100644 --- a/api-tests/management/nodes_test.go +++ b/api-tests/management/nodes_test.go @@ -445,3 +445,19 @@ func TestNodeRegister(t *testing.T) { require.Nil(t, registerOK) }) } + +func TestCreateNodeInstallToken(t *testing.T) { + t.Parallel() + + params := mservice.CreateNodeInstallTokenParams{ + Context: pmmapitests.Context, + Body: mservice.CreateNodeInstallTokenBody{ + Technology: "mysql", + }, + } + ok, err := client.Default.ManagementService.CreateNodeInstallToken(¶ms) + require.NoError(t, err) + require.NotNil(t, ok) + require.NotNil(t, ok.Payload) + assert.NotEmpty(t, ok.Payload.Token) +} diff --git a/api/accesscontrol/v1beta1/accesscontrol.pb.go b/api/accesscontrol/v1beta1/accesscontrol.pb.go index f5e8ea4b004..639df37bd7e 100644 --- a/api/accesscontrol/v1beta1/accesscontrol.pb.go +++ b/api/accesscontrol/v1beta1/accesscontrol.pb.go @@ -7,15 +7,14 @@ package accesscontrolv1beta1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -824,27 +823,24 @@ func file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP() []byte { return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescData } -var ( - file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes = make([]protoimpl.MessageInfo, 15) - file_accesscontrol_v1beta1_accesscontrol_proto_goTypes = []any{ - (*CreateRoleRequest)(nil), // 0: accesscontrol.v1beta1.CreateRoleRequest - (*CreateRoleResponse)(nil), // 1: accesscontrol.v1beta1.CreateRoleResponse - (*UpdateRoleRequest)(nil), // 2: accesscontrol.v1beta1.UpdateRoleRequest - (*UpdateRoleResponse)(nil), // 3: accesscontrol.v1beta1.UpdateRoleResponse - (*DeleteRoleRequest)(nil), // 4: accesscontrol.v1beta1.DeleteRoleRequest - (*DeleteRoleResponse)(nil), // 5: accesscontrol.v1beta1.DeleteRoleResponse - (*GetRoleRequest)(nil), // 6: accesscontrol.v1beta1.GetRoleRequest - (*GetRoleResponse)(nil), // 7: accesscontrol.v1beta1.GetRoleResponse - (*SetDefaultRoleRequest)(nil), // 8: accesscontrol.v1beta1.SetDefaultRoleRequest - (*SetDefaultRoleResponse)(nil), // 9: accesscontrol.v1beta1.SetDefaultRoleResponse - (*AssignRolesRequest)(nil), // 10: accesscontrol.v1beta1.AssignRolesRequest - (*AssignRolesResponse)(nil), // 11: accesscontrol.v1beta1.AssignRolesResponse - (*ListRolesRequest)(nil), // 12: accesscontrol.v1beta1.ListRolesRequest - (*ListRolesResponse)(nil), // 13: accesscontrol.v1beta1.ListRolesResponse - (*ListRolesResponse_RoleData)(nil), // 14: accesscontrol.v1beta1.ListRolesResponse.RoleData - } -) - +var file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_accesscontrol_v1beta1_accesscontrol_proto_goTypes = []any{ + (*CreateRoleRequest)(nil), // 0: accesscontrol.v1beta1.CreateRoleRequest + (*CreateRoleResponse)(nil), // 1: accesscontrol.v1beta1.CreateRoleResponse + (*UpdateRoleRequest)(nil), // 2: accesscontrol.v1beta1.UpdateRoleRequest + (*UpdateRoleResponse)(nil), // 3: accesscontrol.v1beta1.UpdateRoleResponse + (*DeleteRoleRequest)(nil), // 4: accesscontrol.v1beta1.DeleteRoleRequest + (*DeleteRoleResponse)(nil), // 5: accesscontrol.v1beta1.DeleteRoleResponse + (*GetRoleRequest)(nil), // 6: accesscontrol.v1beta1.GetRoleRequest + (*GetRoleResponse)(nil), // 7: accesscontrol.v1beta1.GetRoleResponse + (*SetDefaultRoleRequest)(nil), // 8: accesscontrol.v1beta1.SetDefaultRoleRequest + (*SetDefaultRoleResponse)(nil), // 9: accesscontrol.v1beta1.SetDefaultRoleResponse + (*AssignRolesRequest)(nil), // 10: accesscontrol.v1beta1.AssignRolesRequest + (*AssignRolesResponse)(nil), // 11: accesscontrol.v1beta1.AssignRolesResponse + (*ListRolesRequest)(nil), // 12: accesscontrol.v1beta1.ListRolesRequest + (*ListRolesResponse)(nil), // 13: accesscontrol.v1beta1.ListRolesResponse + (*ListRolesResponse_RoleData)(nil), // 14: accesscontrol.v1beta1.ListRolesResponse.RoleData +} var file_accesscontrol_v1beta1_accesscontrol_proto_depIdxs = []int32{ 14, // 0: accesscontrol.v1beta1.ListRolesResponse.roles:type_name -> accesscontrol.v1beta1.ListRolesResponse.RoleData 0, // 1: accesscontrol.v1beta1.AccessControlService.CreateRole:input_type -> accesscontrol.v1beta1.CreateRoleRequest diff --git a/api/accesscontrol/v1beta1/accesscontrol.pb.validate.go b/api/accesscontrol/v1beta1/accesscontrol.pb.validate.go index a055badfff2..eb8ae6ba022 100644 --- a/api/accesscontrol/v1beta1/accesscontrol.pb.validate.go +++ b/api/accesscontrol/v1beta1/accesscontrol.pb.validate.go @@ -290,6 +290,7 @@ func (m *UpdateRoleRequest) validate(all bool) error { } if m.Title != nil { + if utf8.RuneCountInString(m.GetTitle()) < 1 { err := UpdateRoleRequestValidationError{ field: "Title", @@ -300,6 +301,7 @@ func (m *UpdateRoleRequest) validate(all bool) error { } errors = append(errors, err) } + } if m.Filter != nil { diff --git a/api/accesscontrol/v1beta1/accesscontrol.swagger.json b/api/accesscontrol/v1beta1/accesscontrol.swagger.json new file mode 100644 index 00000000000..d9435ab700b --- /dev/null +++ b/api/accesscontrol/v1beta1/accesscontrol.swagger.json @@ -0,0 +1,410 @@ +{ + "swagger": "2.0", + "info": { + "title": "accesscontrol/v1beta1/accesscontrol.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "AccessControlService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/accesscontrol/roles": { + "get": { + "summary": "List Roles", + "description": "Lists all roles.", + "operationId": "ListRoles", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1ListRolesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "AccessControlService" + ] + }, + "post": { + "summary": "Create a Role", + "description": "Creates a new role.", + "operationId": "CreateRole", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1CreateRoleResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1beta1CreateRoleRequest" + } + } + ], + "tags": [ + "AccessControlService" + ] + } + }, + "/v1/accesscontrol/roles/{role_id}": { + "get": { + "summary": "Get a Role", + "description": "Retrieves a role by ID.", + "operationId": "GetRole", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1GetRoleResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "role_id", + "in": "path", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "AccessControlService" + ] + }, + "delete": { + "summary": "Delete a Role", + "description": "Deletes a role.", + "operationId": "DeleteRole", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1DeleteRoleResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "role_id", + "in": "path", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "replacement_role_id", + "description": "Role ID to be used as a replacement for the role. Additional logic applies.", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "AccessControlService" + ] + }, + "put": { + "summary": "Update a Role", + "description": "Updates an existing role.", + "operationId": "UpdateRole", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1UpdateRoleResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "role_id", + "in": "path", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AccessControlServiceUpdateRoleBody" + } + } + ], + "tags": [ + "AccessControlService" + ] + } + }, + "/v1/accesscontrol/roles:assign": { + "post": { + "summary": "Assign Roles to a User", + "description": "Replaces all existing roles for a user.", + "operationId": "AssignRoles", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1AssignRolesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1beta1AssignRolesRequest" + } + } + ], + "tags": [ + "AccessControlService" + ] + } + }, + "/v1/accesscontrol/roles:setDefault": { + "post": { + "summary": "Set a Default Role", + "description": "Configures a default role assigned to users.", + "operationId": "SetDefaultRole", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1SetDefaultRoleResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1beta1SetDefaultRoleRequest" + } + } + ], + "tags": [ + "AccessControlService" + ] + } + } + }, + "definitions": { + "AccessControlServiceUpdateRoleBody": { + "type": "object", + "properties": { + "title": { + "type": "string", + "x-nullable": true + }, + "filter": { + "type": "string", + "x-nullable": true + }, + "description": { + "type": "string", + "x-nullable": true + } + } + }, + "ListRolesResponseRoleData": { + "type": "object", + "properties": { + "role_id": { + "type": "integer", + "format": "int64" + }, + "title": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "description": { + "type": "string" + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1beta1AssignRolesRequest": { + "type": "object", + "properties": { + "role_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + "user_id": { + "type": "integer", + "format": "int64" + } + } + }, + "v1beta1AssignRolesResponse": { + "type": "object" + }, + "v1beta1CreateRoleRequest": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "description": { + "type": "string" + } + } + }, + "v1beta1CreateRoleResponse": { + "type": "object", + "properties": { + "role_id": { + "type": "integer", + "format": "int64" + } + } + }, + "v1beta1DeleteRoleResponse": { + "type": "object" + }, + "v1beta1GetRoleResponse": { + "type": "object", + "properties": { + "role_id": { + "type": "integer", + "format": "int64" + }, + "title": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "description": { + "type": "string" + } + } + }, + "v1beta1ListRolesResponse": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/ListRolesResponseRoleData" + } + } + } + }, + "v1beta1SetDefaultRoleRequest": { + "type": "object", + "properties": { + "role_id": { + "type": "integer", + "format": "int64" + } + } + }, + "v1beta1SetDefaultRoleResponse": { + "type": "object" + }, + "v1beta1UpdateRoleResponse": { + "type": "object" + } + } +} diff --git a/api/accesscontrol/v1beta1/accesscontrol_grpc.pb.go b/api/accesscontrol/v1beta1/accesscontrol_grpc.pb.go index 27f509ee6f5..f868b277a03 100644 --- a/api/accesscontrol/v1beta1/accesscontrol_grpc.pb.go +++ b/api/accesscontrol/v1beta1/accesscontrol_grpc.pb.go @@ -8,7 +8,6 @@ package accesscontrolv1beta1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -162,27 +161,21 @@ type UnimplementedAccessControlServiceServer struct{} func (UnimplementedAccessControlServiceServer) CreateRole(context.Context, *CreateRoleRequest) (*CreateRoleResponse, error) { return nil, status.Error(codes.Unimplemented, "method CreateRole not implemented") } - func (UnimplementedAccessControlServiceServer) UpdateRole(context.Context, *UpdateRoleRequest) (*UpdateRoleResponse, error) { return nil, status.Error(codes.Unimplemented, "method UpdateRole not implemented") } - func (UnimplementedAccessControlServiceServer) DeleteRole(context.Context, *DeleteRoleRequest) (*DeleteRoleResponse, error) { return nil, status.Error(codes.Unimplemented, "method DeleteRole not implemented") } - func (UnimplementedAccessControlServiceServer) GetRole(context.Context, *GetRoleRequest) (*GetRoleResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetRole not implemented") } - func (UnimplementedAccessControlServiceServer) ListRoles(context.Context, *ListRolesRequest) (*ListRolesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListRoles not implemented") } - func (UnimplementedAccessControlServiceServer) AssignRoles(context.Context, *AssignRolesRequest) (*AssignRolesResponse, error) { return nil, status.Error(codes.Unimplemented, "method AssignRoles not implemented") } - func (UnimplementedAccessControlServiceServer) SetDefaultRole(context.Context, *SetDefaultRoleRequest) (*SetDefaultRoleResponse, error) { return nil, status.Error(codes.Unimplemented, "method SetDefaultRole not implemented") } diff --git a/api/actions/v1/actions.pb.go b/api/actions/v1/actions.pb.go index 8cc8bdac9e8..c22f9dab1a2 100644 --- a/api/actions/v1/actions.pb.go +++ b/api/actions/v1/actions.pb.go @@ -7,15 +7,14 @@ package actionsv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -2610,46 +2609,43 @@ func file_actions_v1_actions_proto_rawDescGZIP() []byte { return file_actions_v1_actions_proto_rawDescData } -var ( - file_actions_v1_actions_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_actions_v1_actions_proto_msgTypes = make([]protoimpl.MessageInfo, 32) - file_actions_v1_actions_proto_goTypes = []any{ - (ActionType)(0), // 0: actions.v1.ActionType - (*GetActionRequest)(nil), // 1: actions.v1.GetActionRequest - (*GetActionResponse)(nil), // 2: actions.v1.GetActionResponse - (*StartMySQLExplainActionParams)(nil), // 3: actions.v1.StartMySQLExplainActionParams - (*StartMySQLExplainActionResult)(nil), // 4: actions.v1.StartMySQLExplainActionResult - (*StartMySQLExplainJSONActionParams)(nil), // 5: actions.v1.StartMySQLExplainJSONActionParams - (*StartMySQLExplainJSONActionResult)(nil), // 6: actions.v1.StartMySQLExplainJSONActionResult - (*StartMySQLExplainTraditionalJSONActionParams)(nil), // 7: actions.v1.StartMySQLExplainTraditionalJSONActionParams - (*StartMySQLExplainTraditionalJSONActionResult)(nil), // 8: actions.v1.StartMySQLExplainTraditionalJSONActionResult - (*StartMySQLShowCreateTableActionParams)(nil), // 9: actions.v1.StartMySQLShowCreateTableActionParams - (*StartMySQLShowCreateTableActionResult)(nil), // 10: actions.v1.StartMySQLShowCreateTableActionResult - (*StartMySQLShowTableStatusActionParams)(nil), // 11: actions.v1.StartMySQLShowTableStatusActionParams - (*StartMySQLShowTableStatusActionResult)(nil), // 12: actions.v1.StartMySQLShowTableStatusActionResult - (*StartMySQLShowIndexActionParams)(nil), // 13: actions.v1.StartMySQLShowIndexActionParams - (*StartMySQLShowIndexActionResult)(nil), // 14: actions.v1.StartMySQLShowIndexActionResult - (*StartPostgreSQLShowCreateTableActionParams)(nil), // 15: actions.v1.StartPostgreSQLShowCreateTableActionParams - (*StartPostgreSQLShowCreateTableActionResult)(nil), // 16: actions.v1.StartPostgreSQLShowCreateTableActionResult - (*StartPostgreSQLShowIndexActionParams)(nil), // 17: actions.v1.StartPostgreSQLShowIndexActionParams - (*StartPostgreSQLShowIndexActionResult)(nil), // 18: actions.v1.StartPostgreSQLShowIndexActionResult - (*StartMongoDBExplainActionParams)(nil), // 19: actions.v1.StartMongoDBExplainActionParams - (*StartMongoDBExplainActionResult)(nil), // 20: actions.v1.StartMongoDBExplainActionResult - (*StartPTPgSummaryActionParams)(nil), // 21: actions.v1.StartPTPgSummaryActionParams - (*StartPTPgSummaryActionResult)(nil), // 22: actions.v1.StartPTPgSummaryActionResult - (*StartPTMongoDBSummaryActionParams)(nil), // 23: actions.v1.StartPTMongoDBSummaryActionParams - (*StartPTMongoDBSummaryActionResult)(nil), // 24: actions.v1.StartPTMongoDBSummaryActionResult - (*StartPTMySQLSummaryActionParams)(nil), // 25: actions.v1.StartPTMySQLSummaryActionParams - (*StartPTMySQLSummaryActionResult)(nil), // 26: actions.v1.StartPTMySQLSummaryActionResult - (*StartPTSummaryActionRequest)(nil), // 27: actions.v1.StartPTSummaryActionRequest - (*StartPTSummaryActionResponse)(nil), // 28: actions.v1.StartPTSummaryActionResponse - (*CancelActionRequest)(nil), // 29: actions.v1.CancelActionRequest - (*CancelActionResponse)(nil), // 30: actions.v1.CancelActionResponse - (*StartServiceActionRequest)(nil), // 31: actions.v1.StartServiceActionRequest - (*StartServiceActionResponse)(nil), // 32: actions.v1.StartServiceActionResponse - } -) - +var file_actions_v1_actions_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_actions_v1_actions_proto_msgTypes = make([]protoimpl.MessageInfo, 32) +var file_actions_v1_actions_proto_goTypes = []any{ + (ActionType)(0), // 0: actions.v1.ActionType + (*GetActionRequest)(nil), // 1: actions.v1.GetActionRequest + (*GetActionResponse)(nil), // 2: actions.v1.GetActionResponse + (*StartMySQLExplainActionParams)(nil), // 3: actions.v1.StartMySQLExplainActionParams + (*StartMySQLExplainActionResult)(nil), // 4: actions.v1.StartMySQLExplainActionResult + (*StartMySQLExplainJSONActionParams)(nil), // 5: actions.v1.StartMySQLExplainJSONActionParams + (*StartMySQLExplainJSONActionResult)(nil), // 6: actions.v1.StartMySQLExplainJSONActionResult + (*StartMySQLExplainTraditionalJSONActionParams)(nil), // 7: actions.v1.StartMySQLExplainTraditionalJSONActionParams + (*StartMySQLExplainTraditionalJSONActionResult)(nil), // 8: actions.v1.StartMySQLExplainTraditionalJSONActionResult + (*StartMySQLShowCreateTableActionParams)(nil), // 9: actions.v1.StartMySQLShowCreateTableActionParams + (*StartMySQLShowCreateTableActionResult)(nil), // 10: actions.v1.StartMySQLShowCreateTableActionResult + (*StartMySQLShowTableStatusActionParams)(nil), // 11: actions.v1.StartMySQLShowTableStatusActionParams + (*StartMySQLShowTableStatusActionResult)(nil), // 12: actions.v1.StartMySQLShowTableStatusActionResult + (*StartMySQLShowIndexActionParams)(nil), // 13: actions.v1.StartMySQLShowIndexActionParams + (*StartMySQLShowIndexActionResult)(nil), // 14: actions.v1.StartMySQLShowIndexActionResult + (*StartPostgreSQLShowCreateTableActionParams)(nil), // 15: actions.v1.StartPostgreSQLShowCreateTableActionParams + (*StartPostgreSQLShowCreateTableActionResult)(nil), // 16: actions.v1.StartPostgreSQLShowCreateTableActionResult + (*StartPostgreSQLShowIndexActionParams)(nil), // 17: actions.v1.StartPostgreSQLShowIndexActionParams + (*StartPostgreSQLShowIndexActionResult)(nil), // 18: actions.v1.StartPostgreSQLShowIndexActionResult + (*StartMongoDBExplainActionParams)(nil), // 19: actions.v1.StartMongoDBExplainActionParams + (*StartMongoDBExplainActionResult)(nil), // 20: actions.v1.StartMongoDBExplainActionResult + (*StartPTPgSummaryActionParams)(nil), // 21: actions.v1.StartPTPgSummaryActionParams + (*StartPTPgSummaryActionResult)(nil), // 22: actions.v1.StartPTPgSummaryActionResult + (*StartPTMongoDBSummaryActionParams)(nil), // 23: actions.v1.StartPTMongoDBSummaryActionParams + (*StartPTMongoDBSummaryActionResult)(nil), // 24: actions.v1.StartPTMongoDBSummaryActionResult + (*StartPTMySQLSummaryActionParams)(nil), // 25: actions.v1.StartPTMySQLSummaryActionParams + (*StartPTMySQLSummaryActionResult)(nil), // 26: actions.v1.StartPTMySQLSummaryActionResult + (*StartPTSummaryActionRequest)(nil), // 27: actions.v1.StartPTSummaryActionRequest + (*StartPTSummaryActionResponse)(nil), // 28: actions.v1.StartPTSummaryActionResponse + (*CancelActionRequest)(nil), // 29: actions.v1.CancelActionRequest + (*CancelActionResponse)(nil), // 30: actions.v1.CancelActionResponse + (*StartServiceActionRequest)(nil), // 31: actions.v1.StartServiceActionRequest + (*StartServiceActionResponse)(nil), // 32: actions.v1.StartServiceActionResponse +} var file_actions_v1_actions_proto_depIdxs = []int32{ 3, // 0: actions.v1.StartServiceActionRequest.mysql_explain:type_name -> actions.v1.StartMySQLExplainActionParams 5, // 1: actions.v1.StartServiceActionRequest.mysql_explain_json:type_name -> actions.v1.StartMySQLExplainJSONActionParams diff --git a/api/actions/v1/actions.swagger.json b/api/actions/v1/actions.swagger.json new file mode 100644 index 00000000000..04404da66a7 --- /dev/null +++ b/api/actions/v1/actions.swagger.json @@ -0,0 +1,737 @@ +{ + "swagger": "2.0", + "info": { + "title": "actions/v1/actions.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "ActionsService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/actions/{action_id}": { + "get": { + "summary": "Get Action", + "description": "Gets the result of a given Action.", + "operationId": "GetAction", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetActionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "action_id", + "description": "Unique Action ID.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "ActionsService" + ] + } + }, + "/v1/actions:cancelAction": { + "post": { + "summary": "Cancel an Action", + "description": "Stops an Action.", + "operationId": "CancelAction", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CancelActionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CancelActionRequest" + } + } + ], + "tags": [ + "ActionsService" + ] + } + }, + "/v1/actions:startNodeAction": { + "post": { + "summary": "Start 'PT Summary' Action", + "description": "Starts 'Percona Toolkit Summary' Action.", + "operationId": "StartPTSummaryAction", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StartPTSummaryActionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1StartPTSummaryActionRequest" + } + } + ], + "tags": [ + "ActionsService" + ] + } + }, + "/v1/actions:startServiceAction": { + "post": { + "summary": "Start a Service Action", + "description": "Starts a Service Action.", + "operationId": "StartServiceAction", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StartServiceActionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1StartServiceActionRequest" + } + } + ], + "tags": [ + "ActionsService" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1CancelActionRequest": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID. Required." + } + } + }, + "v1CancelActionResponse": { + "type": "object" + }, + "v1GetActionResponse": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where this Action is running / was run." + }, + "output": { + "type": "string", + "description": "Current Action output; may be partial if Action is still running." + }, + "done": { + "type": "boolean", + "description": "True if Action is finished." + }, + "error": { + "type": "string", + "description": "Error message if Action failed." + } + } + }, + "v1StartMongoDBExplainActionParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to run this Action." + }, + "service_id": { + "type": "string", + "description": "Service ID for this Action. Required." + }, + "query": { + "type": "string", + "description": "Query. Required." + } + } + }, + "v1StartMongoDBExplainActionResult": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to this Action was started." + } + } + }, + "v1StartMySQLExplainActionParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to run this Action." + }, + "service_id": { + "type": "string", + "description": "Service ID for this Action. Required." + }, + "query_id": { + "type": "string", + "description": "Query ID of query." + }, + "placeholders": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Array of placeholder values" + }, + "database": { + "type": "string", + "description": "Database name. Required if it can't be deduced from the query ID." + } + } + }, + "v1StartMySQLExplainActionResult": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to this Action was started." + } + } + }, + "v1StartMySQLExplainJSONActionParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to run this Action." + }, + "service_id": { + "type": "string", + "description": "Service ID for this Action. Required." + }, + "query_id": { + "type": "string", + "description": "Query ID of query." + }, + "placeholders": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Array of placeholder values" + }, + "database": { + "type": "string", + "description": "Database name. Required if it can't be deduced from the query ID." + } + } + }, + "v1StartMySQLExplainJSONActionResult": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to this Action was started." + } + } + }, + "v1StartMySQLExplainTraditionalJSONActionParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to run this Action." + }, + "service_id": { + "type": "string", + "description": "Service ID for this Action. Required." + }, + "query_id": { + "type": "string", + "description": "Query ID of query." + }, + "placeholders": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Array of placeholder values" + }, + "database": { + "type": "string", + "description": "Database name. Required if it can't be deduced from the query ID." + } + } + }, + "v1StartMySQLExplainTraditionalJSONActionResult": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to this Action was started." + } + } + }, + "v1StartMySQLShowCreateTableActionParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to run this Action." + }, + "service_id": { + "type": "string", + "description": "Service ID for this Action. Required." + }, + "table_name": { + "type": "string", + "description": "Table name. Required. May additionally contain a database name." + }, + "database": { + "type": "string", + "description": "Database name. Required if not given in the table_name field." + } + } + }, + "v1StartMySQLShowCreateTableActionResult": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to this Action was started." + } + } + }, + "v1StartMySQLShowIndexActionParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to run this Action." + }, + "service_id": { + "type": "string", + "description": "Service ID for this Action. Required." + }, + "table_name": { + "type": "string", + "description": "Table name. Required. May additionally contain a database name." + }, + "database": { + "type": "string", + "description": "Database name. Required if not given in the table_name field." + } + } + }, + "v1StartMySQLShowIndexActionResult": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to this Action was started." + } + } + }, + "v1StartMySQLShowTableStatusActionParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to run this Action." + }, + "service_id": { + "type": "string", + "description": "Service ID for this Action. Required." + }, + "table_name": { + "type": "string", + "description": "Table name. Required. May additionally contain a database name." + }, + "database": { + "type": "string", + "description": "Database name. Required if not given in the table_name field." + } + } + }, + "v1StartMySQLShowTableStatusActionResult": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to this Action was started." + } + } + }, + "v1StartPTMongoDBSummaryActionParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to run this Action." + }, + "service_id": { + "type": "string", + "description": "Service ID for this Action." + } + }, + "title": "Message to prepare pt-mongodb-summary data" + }, + "v1StartPTMongoDBSummaryActionResult": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to this Action was started." + } + }, + "title": "Message to retrieve the prepared pt-mongodb-summary data" + }, + "v1StartPTMySQLSummaryActionParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to run this Action." + }, + "service_id": { + "type": "string", + "description": "Service ID for this Action." + } + }, + "title": "Message to prepare pt-mysql-summary data" + }, + "v1StartPTMySQLSummaryActionResult": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to this Action was started." + } + }, + "title": "Message to retrieve the prepared pt-mysql-summary data" + }, + "v1StartPTPgSummaryActionParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to run this Action." + }, + "service_id": { + "type": "string", + "description": "Service ID for this Action." + } + }, + "title": "Message to prepare pt-pg-summary data" + }, + "v1StartPTPgSummaryActionResult": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to this Action was started." + } + }, + "title": "Message to retrieve the prepared pt-pg-summary data" + }, + "v1StartPTSummaryActionRequest": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to run this Action." + }, + "node_id": { + "type": "string", + "description": "Node ID for this Action." + } + } + }, + "v1StartPTSummaryActionResponse": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to this Action was started." + } + } + }, + "v1StartPostgreSQLShowCreateTableActionParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to run this Action." + }, + "service_id": { + "type": "string", + "description": "Service ID for this Action. Required." + }, + "table_name": { + "type": "string", + "description": "Table name. Required. May additionally contain a database name." + }, + "database": { + "type": "string", + "description": "Database name. Required if not given in the table_name field." + } + } + }, + "v1StartPostgreSQLShowCreateTableActionResult": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to this Action was started." + } + } + }, + "v1StartPostgreSQLShowIndexActionParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to run this Action." + }, + "service_id": { + "type": "string", + "description": "Service ID for this Action. Required." + }, + "table_name": { + "type": "string", + "description": "Table name. Required. May additionally contain a database name." + }, + "database": { + "type": "string", + "description": "Database name. Required if not given in the table_name field." + } + } + }, + "v1StartPostgreSQLShowIndexActionResult": { + "type": "object", + "properties": { + "action_id": { + "type": "string", + "description": "Unique Action ID." + }, + "pmm_agent_id": { + "type": "string", + "description": "pmm-agent ID where to this Action was started." + } + } + }, + "v1StartServiceActionRequest": { + "type": "object", + "properties": { + "mysql_explain": { + "$ref": "#/definitions/v1StartMySQLExplainActionParams" + }, + "mysql_explain_json": { + "$ref": "#/definitions/v1StartMySQLExplainJSONActionParams" + }, + "mysql_explain_traditional_json": { + "$ref": "#/definitions/v1StartMySQLExplainTraditionalJSONActionParams" + }, + "mysql_show_index": { + "$ref": "#/definitions/v1StartMySQLShowIndexActionParams" + }, + "mysql_show_create_table": { + "$ref": "#/definitions/v1StartMySQLShowCreateTableActionParams" + }, + "mysql_show_table_status": { + "$ref": "#/definitions/v1StartMySQLShowTableStatusActionParams" + }, + "postgres_show_create_table": { + "$ref": "#/definitions/v1StartPostgreSQLShowCreateTableActionParams" + }, + "postgres_show_index": { + "$ref": "#/definitions/v1StartPostgreSQLShowIndexActionParams" + }, + "mongodb_explain": { + "$ref": "#/definitions/v1StartMongoDBExplainActionParams" + }, + "pt_mongodb_summary": { + "$ref": "#/definitions/v1StartPTMongoDBSummaryActionParams" + }, + "pt_mysql_summary": { + "$ref": "#/definitions/v1StartPTMySQLSummaryActionParams" + }, + "pt_postgres_summary": { + "$ref": "#/definitions/v1StartPTPgSummaryActionParams" + } + } + }, + "v1StartServiceActionResponse": { + "type": "object", + "properties": { + "mysql_explain": { + "$ref": "#/definitions/v1StartMySQLExplainActionResult" + }, + "mysql_explain_json": { + "$ref": "#/definitions/v1StartMySQLExplainJSONActionResult" + }, + "mysql_explain_traditional_json": { + "$ref": "#/definitions/v1StartMySQLExplainTraditionalJSONActionResult" + }, + "mysql_show_index": { + "$ref": "#/definitions/v1StartMySQLShowIndexActionResult" + }, + "mysql_show_create_table": { + "$ref": "#/definitions/v1StartMySQLShowCreateTableActionResult" + }, + "mysql_show_table_status": { + "$ref": "#/definitions/v1StartMySQLShowTableStatusActionResult" + }, + "postgresql_show_create_table": { + "$ref": "#/definitions/v1StartPostgreSQLShowCreateTableActionResult" + }, + "postgresql_show_index": { + "$ref": "#/definitions/v1StartPostgreSQLShowIndexActionResult" + }, + "mongodb_explain": { + "$ref": "#/definitions/v1StartMongoDBExplainActionResult" + }, + "pt_mongodb_summary": { + "$ref": "#/definitions/v1StartPTMongoDBSummaryActionResult" + }, + "pt_mysql_summary": { + "$ref": "#/definitions/v1StartPTMySQLSummaryActionResult" + }, + "pt_postgres_summary": { + "$ref": "#/definitions/v1StartPTPgSummaryActionResult" + } + } + } + } +} diff --git a/api/actions/v1/actions_grpc.pb.go b/api/actions/v1/actions_grpc.pb.go index cfe06386498..f9fb5ad5c81 100644 --- a/api/actions/v1/actions_grpc.pb.go +++ b/api/actions/v1/actions_grpc.pb.go @@ -8,7 +8,6 @@ package actionsv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -117,15 +116,12 @@ type UnimplementedActionsServiceServer struct{} func (UnimplementedActionsServiceServer) GetAction(context.Context, *GetActionRequest) (*GetActionResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetAction not implemented") } - func (UnimplementedActionsServiceServer) StartServiceAction(context.Context, *StartServiceActionRequest) (*StartServiceActionResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartServiceAction not implemented") } - func (UnimplementedActionsServiceServer) StartPTSummaryAction(context.Context, *StartPTSummaryActionRequest) (*StartPTSummaryActionResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartPTSummaryAction not implemented") } - func (UnimplementedActionsServiceServer) CancelAction(context.Context, *CancelActionRequest) (*CancelActionResponse, error) { return nil, status.Error(codes.Unimplemented, "method CancelAction not implemented") } diff --git a/api/advisors/v1/advisors.pb.go b/api/advisors/v1/advisors.pb.go index 1961afd6e44..e86ccdfcea8 100644 --- a/api/advisors/v1/advisors.pb.go +++ b/api/advisors/v1/advisors.pb.go @@ -7,17 +7,15 @@ package advisorsv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + v1 "github.com/percona/pmm/api/management/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - v1 "github.com/percona/pmm/api/management/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -1358,36 +1356,33 @@ func file_advisors_v1_advisors_proto_rawDescGZIP() []byte { return file_advisors_v1_advisors_proto_rawDescData } -var ( - file_advisors_v1_advisors_proto_enumTypes = make([]protoimpl.EnumInfo, 2) - file_advisors_v1_advisors_proto_msgTypes = make([]protoimpl.MessageInfo, 20) - file_advisors_v1_advisors_proto_goTypes = []any{ - (AdvisorCheckInterval)(0), // 0: advisors.v1.AdvisorCheckInterval - (AdvisorCheckFamily)(0), // 1: advisors.v1.AdvisorCheckFamily - (*AdvisorCheckResult)(nil), // 2: advisors.v1.AdvisorCheckResult - (*CheckResultSummary)(nil), // 3: advisors.v1.CheckResultSummary - (*CheckResult)(nil), // 4: advisors.v1.CheckResult - (*AdvisorCheck)(nil), // 5: advisors.v1.AdvisorCheck - (*Advisor)(nil), // 6: advisors.v1.Advisor - (*ChangeAdvisorCheckParams)(nil), // 7: advisors.v1.ChangeAdvisorCheckParams - (*StartAdvisorChecksRequest)(nil), // 8: advisors.v1.StartAdvisorChecksRequest - (*StartAdvisorChecksResponse)(nil), // 9: advisors.v1.StartAdvisorChecksResponse - (*ListAdvisorChecksRequest)(nil), // 10: advisors.v1.ListAdvisorChecksRequest - (*ListAdvisorChecksResponse)(nil), // 11: advisors.v1.ListAdvisorChecksResponse - (*ListAdvisorsRequest)(nil), // 12: advisors.v1.ListAdvisorsRequest - (*ListAdvisorsResponse)(nil), // 13: advisors.v1.ListAdvisorsResponse - (*ChangeAdvisorChecksRequest)(nil), // 14: advisors.v1.ChangeAdvisorChecksRequest - (*ChangeAdvisorChecksResponse)(nil), // 15: advisors.v1.ChangeAdvisorChecksResponse - (*ListFailedServicesRequest)(nil), // 16: advisors.v1.ListFailedServicesRequest - (*ListFailedServicesResponse)(nil), // 17: advisors.v1.ListFailedServicesResponse - (*GetFailedChecksRequest)(nil), // 18: advisors.v1.GetFailedChecksRequest - (*GetFailedChecksResponse)(nil), // 19: advisors.v1.GetFailedChecksResponse - nil, // 20: advisors.v1.AdvisorCheckResult.LabelsEntry - nil, // 21: advisors.v1.CheckResult.LabelsEntry - (v1.Severity)(0), // 22: management.v1.Severity - } -) - +var file_advisors_v1_advisors_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_advisors_v1_advisors_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_advisors_v1_advisors_proto_goTypes = []any{ + (AdvisorCheckInterval)(0), // 0: advisors.v1.AdvisorCheckInterval + (AdvisorCheckFamily)(0), // 1: advisors.v1.AdvisorCheckFamily + (*AdvisorCheckResult)(nil), // 2: advisors.v1.AdvisorCheckResult + (*CheckResultSummary)(nil), // 3: advisors.v1.CheckResultSummary + (*CheckResult)(nil), // 4: advisors.v1.CheckResult + (*AdvisorCheck)(nil), // 5: advisors.v1.AdvisorCheck + (*Advisor)(nil), // 6: advisors.v1.Advisor + (*ChangeAdvisorCheckParams)(nil), // 7: advisors.v1.ChangeAdvisorCheckParams + (*StartAdvisorChecksRequest)(nil), // 8: advisors.v1.StartAdvisorChecksRequest + (*StartAdvisorChecksResponse)(nil), // 9: advisors.v1.StartAdvisorChecksResponse + (*ListAdvisorChecksRequest)(nil), // 10: advisors.v1.ListAdvisorChecksRequest + (*ListAdvisorChecksResponse)(nil), // 11: advisors.v1.ListAdvisorChecksResponse + (*ListAdvisorsRequest)(nil), // 12: advisors.v1.ListAdvisorsRequest + (*ListAdvisorsResponse)(nil), // 13: advisors.v1.ListAdvisorsResponse + (*ChangeAdvisorChecksRequest)(nil), // 14: advisors.v1.ChangeAdvisorChecksRequest + (*ChangeAdvisorChecksResponse)(nil), // 15: advisors.v1.ChangeAdvisorChecksResponse + (*ListFailedServicesRequest)(nil), // 16: advisors.v1.ListFailedServicesRequest + (*ListFailedServicesResponse)(nil), // 17: advisors.v1.ListFailedServicesResponse + (*GetFailedChecksRequest)(nil), // 18: advisors.v1.GetFailedChecksRequest + (*GetFailedChecksResponse)(nil), // 19: advisors.v1.GetFailedChecksResponse + nil, // 20: advisors.v1.AdvisorCheckResult.LabelsEntry + nil, // 21: advisors.v1.CheckResult.LabelsEntry + (v1.Severity)(0), // 22: management.v1.Severity +} var file_advisors_v1_advisors_proto_depIdxs = []int32{ 22, // 0: advisors.v1.AdvisorCheckResult.severity:type_name -> management.v1.Severity 20, // 1: advisors.v1.AdvisorCheckResult.labels:type_name -> advisors.v1.AdvisorCheckResult.LabelsEntry diff --git a/api/advisors/v1/advisors.pb.validate.go b/api/advisors/v1/advisors.pb.validate.go index ef8f8500241..2c9a192edc4 100644 --- a/api/advisors/v1/advisors.pb.validate.go +++ b/api/advisors/v1/advisors.pb.validate.go @@ -1937,6 +1937,7 @@ func (m *GetFailedChecksRequest) validate(all bool) error { // no validation rules for ServiceId if m.PageSize != nil { + if m.GetPageSize() < 1 { err := GetFailedChecksRequestValidationError{ field: "PageSize", @@ -1947,9 +1948,11 @@ func (m *GetFailedChecksRequest) validate(all bool) error { } errors = append(errors, err) } + } if m.PageIndex != nil { + if m.GetPageIndex() < 0 { err := GetFailedChecksRequestValidationError{ field: "PageIndex", @@ -1960,6 +1963,7 @@ func (m *GetFailedChecksRequest) validate(all bool) error { } errors = append(errors, err) } + } if len(errors) > 0 { diff --git a/api/advisors/v1/advisors.swagger.json b/api/advisors/v1/advisors.swagger.json new file mode 100644 index 00000000000..5cb79b42b6c --- /dev/null +++ b/api/advisors/v1/advisors.swagger.json @@ -0,0 +1,539 @@ +{ + "swagger": "2.0", + "info": { + "title": "advisors/v1/advisors.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "AdvisorService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/advisors": { + "get": { + "summary": "List Advisors", + "description": "List advisors available to the user.", + "operationId": "ListAdvisors", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListAdvisorsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "AdvisorService" + ] + } + }, + "/v1/advisors/checks": { + "get": { + "summary": "List Advisor Checks", + "description": "List advisor checks available to the user.", + "operationId": "ListAdvisorChecks", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListAdvisorChecksResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "AdvisorService" + ] + } + }, + "/v1/advisors/checks/failed": { + "get": { + "summary": "Get Failed Advisor Checks", + "description": "Returns the latest check results for a given service.", + "operationId": "GetFailedChecks", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetFailedChecksResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "page_size", + "description": "Maximum number of results per page.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "page_index", + "description": "Index of the requested page, starts from 0.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "service_id", + "description": "Service ID.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "AdvisorService" + ] + } + }, + "/v1/advisors/checks:batchChange": { + "post": { + "summary": "Change Advisor Checks", + "description": "Enables/disables advisor checks or changes their exec interval.", + "operationId": "ChangeAdvisorChecks", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ChangeAdvisorChecksResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ChangeAdvisorChecksRequest" + } + } + ], + "tags": [ + "AdvisorService" + ] + } + }, + "/v1/advisors/checks:start": { + "post": { + "summary": "Start Advisor Checks", + "description": "Executes Advisor checks and returns when all checks are executed. All available checks will be started if check names aren't specified.", + "operationId": "StartAdvisorChecks", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StartAdvisorChecksResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1StartAdvisorChecksRequest" + } + } + ], + "tags": [ + "AdvisorService" + ] + } + }, + "/v1/advisors/failedServices": { + "get": { + "summary": "List Failed Services", + "description": "Returns a list of services with failed checks and a summary of check results.", + "operationId": "ListFailedServices", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListFailedServicesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "AdvisorService" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1Advisor": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Machine-readable name (ID) that is used in expression." + }, + "description": { + "type": "string", + "description": "Long human-readable description." + }, + "summary": { + "type": "string", + "description": "Short human-readable summary." + }, + "comment": { + "type": "string", + "description": "Comment." + }, + "category": { + "type": "string", + "description": "Category." + }, + "checks": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AdvisorCheck" + }, + "description": "Advisor checks." + } + } + }, + "v1AdvisorCheck": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Machine-readable name (ID) that is used in expression." + }, + "enabled": { + "type": "boolean", + "description": "True if that check is enabled." + }, + "description": { + "type": "string", + "description": "Long human-readable description." + }, + "summary": { + "type": "string", + "description": "Short human-readable summary." + }, + "interval": { + "$ref": "#/definitions/v1AdvisorCheckInterval", + "description": "Check execution interval." + }, + "family": { + "$ref": "#/definitions/v1AdvisorCheckFamily", + "description": "DB family." + } + }, + "description": "AdvisorCheck contains check name and status." + }, + "v1AdvisorCheckFamily": { + "type": "string", + "enum": [ + "ADVISOR_CHECK_FAMILY_UNSPECIFIED", + "ADVISOR_CHECK_FAMILY_MYSQL", + "ADVISOR_CHECK_FAMILY_POSTGRESQL", + "ADVISOR_CHECK_FAMILY_MONGODB" + ], + "default": "ADVISOR_CHECK_FAMILY_UNSPECIFIED" + }, + "v1AdvisorCheckInterval": { + "type": "string", + "enum": [ + "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", + "ADVISOR_CHECK_INTERVAL_STANDARD", + "ADVISOR_CHECK_INTERVAL_FREQUENT", + "ADVISOR_CHECK_INTERVAL_RARE" + ], + "default": "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", + "description": "AdvisorCheckInterval represents possible execution interval values for checks." + }, + "v1ChangeAdvisorCheckParams": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the check to change." + }, + "enable": { + "type": "boolean", + "x-nullable": true + }, + "interval": { + "$ref": "#/definitions/v1AdvisorCheckInterval", + "description": "check execution interval." + } + }, + "description": "ChangeAdvisorCheckParams specifies a single check parameters." + }, + "v1ChangeAdvisorChecksRequest": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ChangeAdvisorCheckParams" + } + } + } + }, + "v1ChangeAdvisorChecksResponse": { + "type": "object" + }, + "v1CheckResult": { + "type": "object", + "properties": { + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "severity": { + "$ref": "#/definitions/v1Severity" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "read_more_url": { + "type": "string", + "description": "URL containing information on how to resolve an issue detected by an Advisor check." + }, + "service_name": { + "type": "string", + "description": "Name of the monitored service on which the check ran." + }, + "service_id": { + "type": "string", + "description": "ID of the monitored service on which the check ran." + }, + "check_name": { + "type": "string", + "title": "Name of the check that failed" + }, + "silenced": { + "type": "boolean", + "title": "Silence status of the check result" + } + }, + "description": "CheckResult represents the check results for a given service." + }, + "v1CheckResultSummary": { + "type": "object", + "properties": { + "service_name": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "emergency_count": { + "type": "integer", + "format": "int64", + "description": "Number of failed checks for this service with severity level \"EMERGENCY\"." + }, + "alert_count": { + "type": "integer", + "format": "int64", + "description": "Number of failed checks for this service with severity level \"ALERT\"." + }, + "critical_count": { + "type": "integer", + "format": "int64", + "description": "Number of failed checks for this service with severity level \"CRITICAL\"." + }, + "error_count": { + "type": "integer", + "format": "int64", + "description": "Number of failed checks for this service with severity level \"ERROR\"." + }, + "warning_count": { + "type": "integer", + "format": "int64", + "description": "Number of failed checks for this service with severity level \"WARNING\"." + }, + "notice_count": { + "type": "integer", + "format": "int64", + "description": "Number of failed checks for this service with severity level \"NOTICE\"." + }, + "info_count": { + "type": "integer", + "format": "int64", + "description": "Number of failed checks for this service with severity level \"INFO\"." + }, + "debug_count": { + "type": "integer", + "format": "int64", + "description": "Number of failed checks for this service with severity level \"DEBUG\"." + } + }, + "description": "CheckResultSummary is a summary of check results." + }, + "v1GetFailedChecksResponse": { + "type": "object", + "properties": { + "total_items": { + "type": "integer", + "format": "int32", + "description": "Total number of results." + }, + "total_pages": { + "type": "integer", + "format": "int32", + "description": "Total number of pages." + }, + "results": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1CheckResult" + }, + "title": "Check results" + } + } + }, + "v1ListAdvisorChecksResponse": { + "type": "object", + "properties": { + "checks": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AdvisorCheck" + } + } + } + }, + "v1ListAdvisorsResponse": { + "type": "object", + "properties": { + "advisors": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Advisor" + } + } + } + }, + "v1ListFailedServicesResponse": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1CheckResultSummary" + } + } + } + }, + "v1Severity": { + "type": "string", + "enum": [ + "SEVERITY_UNSPECIFIED", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ], + "default": "SEVERITY_UNSPECIFIED", + "description": "Severity represents severity level of the check result or alert." + }, + "v1StartAdvisorChecksRequest": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Names of the checks that should be started." + } + } + }, + "v1StartAdvisorChecksResponse": { + "type": "object" + } + } +} diff --git a/api/advisors/v1/advisors_grpc.pb.go b/api/advisors/v1/advisors_grpc.pb.go index 968dd072fc8..b5a99aa9d13 100644 --- a/api/advisors/v1/advisors_grpc.pb.go +++ b/api/advisors/v1/advisors_grpc.pb.go @@ -8,7 +8,6 @@ package advisorsv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -147,23 +146,18 @@ type UnimplementedAdvisorServiceServer struct{} func (UnimplementedAdvisorServiceServer) ListFailedServices(context.Context, *ListFailedServicesRequest) (*ListFailedServicesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListFailedServices not implemented") } - func (UnimplementedAdvisorServiceServer) GetFailedChecks(context.Context, *GetFailedChecksRequest) (*GetFailedChecksResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetFailedChecks not implemented") } - func (UnimplementedAdvisorServiceServer) StartAdvisorChecks(context.Context, *StartAdvisorChecksRequest) (*StartAdvisorChecksResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartAdvisorChecks not implemented") } - func (UnimplementedAdvisorServiceServer) ListAdvisorChecks(context.Context, *ListAdvisorChecksRequest) (*ListAdvisorChecksResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAdvisorChecks not implemented") } - func (UnimplementedAdvisorServiceServer) ListAdvisors(context.Context, *ListAdvisorsRequest) (*ListAdvisorsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAdvisors not implemented") } - func (UnimplementedAdvisorServiceServer) ChangeAdvisorChecks(context.Context, *ChangeAdvisorChecksRequest) (*ChangeAdvisorChecksResponse, error) { return nil, status.Error(codes.Unimplemented, "method ChangeAdvisorChecks not implemented") } diff --git a/api/agent/pb/agent.pb.go b/api/agent/pb/agent.pb.go index cfe97cee491..3e266018313 100644 --- a/api/agent/pb/agent.pb.go +++ b/api/agent/pb/agent.pb.go @@ -7,13 +7,11 @@ package pb import ( - reflect "reflect" - unsafe "unsafe" - + v1 "github.com/percona/pmm/api/agent/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - v1 "github.com/percona/pmm/api/agent/v1" + reflect "reflect" + unsafe "unsafe" ) const ( @@ -37,7 +35,6 @@ var file_agent_pb_agent_proto_goTypes = []any{ (*v1.AgentMessage)(nil), // 0: agent.v1.AgentMessage (*v1.ServerMessage)(nil), // 1: agent.v1.ServerMessage } - var file_agent_pb_agent_proto_depIdxs = []int32{ 0, // 0: agent.Agent.Connect:input_type -> agent.v1.AgentMessage 1, // 1: agent.Agent.Connect:output_type -> agent.v1.ServerMessage diff --git a/api/agent/pb/agent.swagger.json b/api/agent/pb/agent.swagger.json new file mode 100644 index 00000000000..5c75bc6dbe5 --- /dev/null +++ b/api/agent/pb/agent.swagger.json @@ -0,0 +1,55 @@ +{ + "swagger": "2.0", + "info": { + "title": "agent/pb/agent.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "Agent" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + } + }, + "additionalProperties": {}, + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]." + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client." + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + }, + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." + } + }, + "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." + } + } +} diff --git a/api/agent/pb/agent_grpc.pb.go b/api/agent/pb/agent_grpc.pb.go index 6755a51892e..591479ea96f 100644 --- a/api/agent/pb/agent_grpc.pb.go +++ b/api/agent/pb/agent_grpc.pb.go @@ -8,12 +8,10 @@ package pb import ( context "context" - + v1 "github.com/percona/pmm/api/agent/v1" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - - v1 "github.com/percona/pmm/api/agent/v1" ) // This is a compile-time assertion to ensure that this generated file diff --git a/api/agent/v1/agent.pb.go b/api/agent/v1/agent.pb.go index 9169133a80d..134579c7352 100644 --- a/api/agent/v1/agent.pb.go +++ b/api/agent/v1/agent.pb.go @@ -7,18 +7,16 @@ package agentv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - + v11 "github.com/percona/pmm/api/backup/v1" + v1 "github.com/percona/pmm/api/inventory/v1" status "google.golang.org/genproto/googleapis/rpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - v11 "github.com/percona/pmm/api/backup/v1" - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -7109,118 +7107,115 @@ func file_agent_v1_agent_proto_rawDescGZIP() []byte { return file_agent_v1_agent_proto_rawDescData } -var ( - file_agent_v1_agent_proto_enumTypes = make([]protoimpl.EnumInfo, 2) - file_agent_v1_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 92) - file_agent_v1_agent_proto_goTypes = []any{ - (MysqlExplainOutputFormat)(0), // 0: agent.v1.MysqlExplainOutputFormat - (StartActionRequest_RestartSystemServiceParams_SystemService)(0), // 1: agent.v1.StartActionRequest.RestartSystemServiceParams.SystemService - (*TextFiles)(nil), // 2: agent.v1.TextFiles - (*Ping)(nil), // 3: agent.v1.Ping - (*Pong)(nil), // 4: agent.v1.Pong - (*QANCollectRequest)(nil), // 5: agent.v1.QANCollectRequest - (*QANCollectResponse)(nil), // 6: agent.v1.QANCollectResponse - (*StateChangedRequest)(nil), // 7: agent.v1.StateChangedRequest - (*StateChangedResponse)(nil), // 8: agent.v1.StateChangedResponse - (*SetStateRequest)(nil), // 9: agent.v1.SetStateRequest - (*SetStateResponse)(nil), // 10: agent.v1.SetStateResponse - (*QueryActionValue)(nil), // 11: agent.v1.QueryActionValue - (*QueryActionSlice)(nil), // 12: agent.v1.QueryActionSlice - (*QueryActionMap)(nil), // 13: agent.v1.QueryActionMap - (*QueryActionBinary)(nil), // 14: agent.v1.QueryActionBinary - (*QueryActionResult)(nil), // 15: agent.v1.QueryActionResult - (*StartActionRequest)(nil), // 16: agent.v1.StartActionRequest - (*StartActionResponse)(nil), // 17: agent.v1.StartActionResponse - (*StopActionRequest)(nil), // 18: agent.v1.StopActionRequest - (*StopActionResponse)(nil), // 19: agent.v1.StopActionResponse - (*ActionResultRequest)(nil), // 20: agent.v1.ActionResultRequest - (*ActionResultResponse)(nil), // 21: agent.v1.ActionResultResponse - (*PBMSwitchPITRRequest)(nil), // 22: agent.v1.PBMSwitchPITRRequest - (*PBMSwitchPITRResponse)(nil), // 23: agent.v1.PBMSwitchPITRResponse - (*AgentLogsRequest)(nil), // 24: agent.v1.AgentLogsRequest - (*AgentLogsResponse)(nil), // 25: agent.v1.AgentLogsResponse - (*CheckConnectionRequest)(nil), // 26: agent.v1.CheckConnectionRequest - (*CheckConnectionResponse)(nil), // 27: agent.v1.CheckConnectionResponse - (*ServiceInfoRequest)(nil), // 28: agent.v1.ServiceInfoRequest - (*ServiceInfoResponse)(nil), // 29: agent.v1.ServiceInfoResponse - (*JobStatusRequest)(nil), // 30: agent.v1.JobStatusRequest - (*JobStatusResponse)(nil), // 31: agent.v1.JobStatusResponse - (*S3LocationConfig)(nil), // 32: agent.v1.S3LocationConfig - (*FilesystemLocationConfig)(nil), // 33: agent.v1.FilesystemLocationConfig - (*StartJobRequest)(nil), // 34: agent.v1.StartJobRequest - (*StartJobResponse)(nil), // 35: agent.v1.StartJobResponse - (*StopJobRequest)(nil), // 36: agent.v1.StopJobRequest - (*StopJobResponse)(nil), // 37: agent.v1.StopJobResponse - (*JobResult)(nil), // 38: agent.v1.JobResult - (*JobProgress)(nil), // 39: agent.v1.JobProgress - (*GetVersionsRequest)(nil), // 40: agent.v1.GetVersionsRequest - (*GetVersionsResponse)(nil), // 41: agent.v1.GetVersionsResponse - (*AgentMessage)(nil), // 42: agent.v1.AgentMessage - (*ServerMessage)(nil), // 43: agent.v1.ServerMessage - nil, // 44: agent.v1.TextFiles.FilesEntry - (*SetStateRequest_AgentProcess)(nil), // 45: agent.v1.SetStateRequest.AgentProcess - nil, // 46: agent.v1.SetStateRequest.AgentProcessesEntry - (*SetStateRequest_BuiltinAgent)(nil), // 47: agent.v1.SetStateRequest.BuiltinAgent - nil, // 48: agent.v1.SetStateRequest.BuiltinAgentsEntry - nil, // 49: agent.v1.SetStateRequest.AgentProcess.TextFilesEntry - nil, // 50: agent.v1.SetStateRequest.BuiltinAgent.EnvEntry - nil, // 51: agent.v1.QueryActionMap.MapEntry - (*StartActionRequest_MySQLExplainParams)(nil), // 52: agent.v1.StartActionRequest.MySQLExplainParams - (*StartActionRequest_MySQLShowCreateTableParams)(nil), // 53: agent.v1.StartActionRequest.MySQLShowCreateTableParams - (*StartActionRequest_MySQLShowTableStatusParams)(nil), // 54: agent.v1.StartActionRequest.MySQLShowTableStatusParams - (*StartActionRequest_MySQLShowIndexParams)(nil), // 55: agent.v1.StartActionRequest.MySQLShowIndexParams - (*StartActionRequest_PostgreSQLShowCreateTableParams)(nil), // 56: agent.v1.StartActionRequest.PostgreSQLShowCreateTableParams - (*StartActionRequest_PostgreSQLShowIndexParams)(nil), // 57: agent.v1.StartActionRequest.PostgreSQLShowIndexParams - (*StartActionRequest_MongoDBExplainParams)(nil), // 58: agent.v1.StartActionRequest.MongoDBExplainParams - (*StartActionRequest_PTSummaryParams)(nil), // 59: agent.v1.StartActionRequest.PTSummaryParams - (*StartActionRequest_PTPgSummaryParams)(nil), // 60: agent.v1.StartActionRequest.PTPgSummaryParams - (*StartActionRequest_PTMongoDBSummaryParams)(nil), // 61: agent.v1.StartActionRequest.PTMongoDBSummaryParams - (*StartActionRequest_PTMySQLSummaryParams)(nil), // 62: agent.v1.StartActionRequest.PTMySQLSummaryParams - (*StartActionRequest_MySQLQueryShowParams)(nil), // 63: agent.v1.StartActionRequest.MySQLQueryShowParams - (*StartActionRequest_MySQLQuerySelectParams)(nil), // 64: agent.v1.StartActionRequest.MySQLQuerySelectParams - (*StartActionRequest_PostgreSQLQueryShowParams)(nil), // 65: agent.v1.StartActionRequest.PostgreSQLQueryShowParams - (*StartActionRequest_PostgreSQLQuerySelectParams)(nil), // 66: agent.v1.StartActionRequest.PostgreSQLQuerySelectParams - (*StartActionRequest_MongoDBQueryGetParameterParams)(nil), // 67: agent.v1.StartActionRequest.MongoDBQueryGetParameterParams - (*StartActionRequest_MongoDBQueryBuildInfoParams)(nil), // 68: agent.v1.StartActionRequest.MongoDBQueryBuildInfoParams - (*StartActionRequest_MongoDBQueryGetCmdLineOptsParams)(nil), // 69: agent.v1.StartActionRequest.MongoDBQueryGetCmdLineOptsParams - (*StartActionRequest_MongoDBQueryReplSetGetStatusParams)(nil), // 70: agent.v1.StartActionRequest.MongoDBQueryReplSetGetStatusParams - (*StartActionRequest_MongoDBQueryGetDiagnosticDataParams)(nil), // 71: agent.v1.StartActionRequest.MongoDBQueryGetDiagnosticDataParams - (*StartActionRequest_RestartSystemServiceParams)(nil), // 72: agent.v1.StartActionRequest.RestartSystemServiceParams - (*CheckConnectionResponse_Stats)(nil), // 73: agent.v1.CheckConnectionResponse.Stats - (*StartJobRequest_MySQLBackup)(nil), // 74: agent.v1.StartJobRequest.MySQLBackup - (*StartJobRequest_MySQLRestoreBackup)(nil), // 75: agent.v1.StartJobRequest.MySQLRestoreBackup - (*StartJobRequest_MongoDBBackup)(nil), // 76: agent.v1.StartJobRequest.MongoDBBackup - (*StartJobRequest_MongoDBRestoreBackup)(nil), // 77: agent.v1.StartJobRequest.MongoDBRestoreBackup - (*JobResult_Error)(nil), // 78: agent.v1.JobResult.Error - (*JobResult_MongoDBBackup)(nil), // 79: agent.v1.JobResult.MongoDBBackup - (*JobResult_MySQLBackup)(nil), // 80: agent.v1.JobResult.MySQLBackup - (*JobResult_MySQLRestoreBackup)(nil), // 81: agent.v1.JobResult.MySQLRestoreBackup - (*JobResult_MongoDBRestoreBackup)(nil), // 82: agent.v1.JobResult.MongoDBRestoreBackup - (*JobProgress_MySQLBackup)(nil), // 83: agent.v1.JobProgress.MySQLBackup - (*JobProgress_MySQLRestoreBackup)(nil), // 84: agent.v1.JobProgress.MySQLRestoreBackup - (*JobProgress_Logs)(nil), // 85: agent.v1.JobProgress.Logs - (*GetVersionsRequest_MySQLd)(nil), // 86: agent.v1.GetVersionsRequest.MySQLd - (*GetVersionsRequest_Xtrabackup)(nil), // 87: agent.v1.GetVersionsRequest.Xtrabackup - (*GetVersionsRequest_Xbcloud)(nil), // 88: agent.v1.GetVersionsRequest.Xbcloud - (*GetVersionsRequest_Qpress)(nil), // 89: agent.v1.GetVersionsRequest.Qpress - (*GetVersionsRequest_MongoDB)(nil), // 90: agent.v1.GetVersionsRequest.MongoDB - (*GetVersionsRequest_PBM)(nil), // 91: agent.v1.GetVersionsRequest.PBM - (*GetVersionsRequest_Software)(nil), // 92: agent.v1.GetVersionsRequest.Software - (*GetVersionsResponse_Version)(nil), // 93: agent.v1.GetVersionsResponse.Version - (*timestamppb.Timestamp)(nil), // 94: google.protobuf.Timestamp - (*MetricsBucket)(nil), // 95: agent.v1.MetricsBucket - (v1.AgentStatus)(0), // 96: inventory.v1.AgentStatus - (*durationpb.Duration)(nil), // 97: google.protobuf.Duration - (v1.ServiceType)(0), // 98: inventory.v1.ServiceType - (*status.Status)(nil), // 99: google.rpc.Status - (v1.AgentType)(0), // 100: inventory.v1.AgentType - (*v1.RTAOptions)(nil), // 101: inventory.v1.RTAOptions - (v11.DataModel)(0), // 102: backup.v1.DataModel - (*v11.PbmMetadata)(nil), // 103: backup.v1.PbmMetadata - (*v11.Metadata)(nil), // 104: backup.v1.Metadata - } -) - +var file_agent_v1_agent_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_agent_v1_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 92) +var file_agent_v1_agent_proto_goTypes = []any{ + (MysqlExplainOutputFormat)(0), // 0: agent.v1.MysqlExplainOutputFormat + (StartActionRequest_RestartSystemServiceParams_SystemService)(0), // 1: agent.v1.StartActionRequest.RestartSystemServiceParams.SystemService + (*TextFiles)(nil), // 2: agent.v1.TextFiles + (*Ping)(nil), // 3: agent.v1.Ping + (*Pong)(nil), // 4: agent.v1.Pong + (*QANCollectRequest)(nil), // 5: agent.v1.QANCollectRequest + (*QANCollectResponse)(nil), // 6: agent.v1.QANCollectResponse + (*StateChangedRequest)(nil), // 7: agent.v1.StateChangedRequest + (*StateChangedResponse)(nil), // 8: agent.v1.StateChangedResponse + (*SetStateRequest)(nil), // 9: agent.v1.SetStateRequest + (*SetStateResponse)(nil), // 10: agent.v1.SetStateResponse + (*QueryActionValue)(nil), // 11: agent.v1.QueryActionValue + (*QueryActionSlice)(nil), // 12: agent.v1.QueryActionSlice + (*QueryActionMap)(nil), // 13: agent.v1.QueryActionMap + (*QueryActionBinary)(nil), // 14: agent.v1.QueryActionBinary + (*QueryActionResult)(nil), // 15: agent.v1.QueryActionResult + (*StartActionRequest)(nil), // 16: agent.v1.StartActionRequest + (*StartActionResponse)(nil), // 17: agent.v1.StartActionResponse + (*StopActionRequest)(nil), // 18: agent.v1.StopActionRequest + (*StopActionResponse)(nil), // 19: agent.v1.StopActionResponse + (*ActionResultRequest)(nil), // 20: agent.v1.ActionResultRequest + (*ActionResultResponse)(nil), // 21: agent.v1.ActionResultResponse + (*PBMSwitchPITRRequest)(nil), // 22: agent.v1.PBMSwitchPITRRequest + (*PBMSwitchPITRResponse)(nil), // 23: agent.v1.PBMSwitchPITRResponse + (*AgentLogsRequest)(nil), // 24: agent.v1.AgentLogsRequest + (*AgentLogsResponse)(nil), // 25: agent.v1.AgentLogsResponse + (*CheckConnectionRequest)(nil), // 26: agent.v1.CheckConnectionRequest + (*CheckConnectionResponse)(nil), // 27: agent.v1.CheckConnectionResponse + (*ServiceInfoRequest)(nil), // 28: agent.v1.ServiceInfoRequest + (*ServiceInfoResponse)(nil), // 29: agent.v1.ServiceInfoResponse + (*JobStatusRequest)(nil), // 30: agent.v1.JobStatusRequest + (*JobStatusResponse)(nil), // 31: agent.v1.JobStatusResponse + (*S3LocationConfig)(nil), // 32: agent.v1.S3LocationConfig + (*FilesystemLocationConfig)(nil), // 33: agent.v1.FilesystemLocationConfig + (*StartJobRequest)(nil), // 34: agent.v1.StartJobRequest + (*StartJobResponse)(nil), // 35: agent.v1.StartJobResponse + (*StopJobRequest)(nil), // 36: agent.v1.StopJobRequest + (*StopJobResponse)(nil), // 37: agent.v1.StopJobResponse + (*JobResult)(nil), // 38: agent.v1.JobResult + (*JobProgress)(nil), // 39: agent.v1.JobProgress + (*GetVersionsRequest)(nil), // 40: agent.v1.GetVersionsRequest + (*GetVersionsResponse)(nil), // 41: agent.v1.GetVersionsResponse + (*AgentMessage)(nil), // 42: agent.v1.AgentMessage + (*ServerMessage)(nil), // 43: agent.v1.ServerMessage + nil, // 44: agent.v1.TextFiles.FilesEntry + (*SetStateRequest_AgentProcess)(nil), // 45: agent.v1.SetStateRequest.AgentProcess + nil, // 46: agent.v1.SetStateRequest.AgentProcessesEntry + (*SetStateRequest_BuiltinAgent)(nil), // 47: agent.v1.SetStateRequest.BuiltinAgent + nil, // 48: agent.v1.SetStateRequest.BuiltinAgentsEntry + nil, // 49: agent.v1.SetStateRequest.AgentProcess.TextFilesEntry + nil, // 50: agent.v1.SetStateRequest.BuiltinAgent.EnvEntry + nil, // 51: agent.v1.QueryActionMap.MapEntry + (*StartActionRequest_MySQLExplainParams)(nil), // 52: agent.v1.StartActionRequest.MySQLExplainParams + (*StartActionRequest_MySQLShowCreateTableParams)(nil), // 53: agent.v1.StartActionRequest.MySQLShowCreateTableParams + (*StartActionRequest_MySQLShowTableStatusParams)(nil), // 54: agent.v1.StartActionRequest.MySQLShowTableStatusParams + (*StartActionRequest_MySQLShowIndexParams)(nil), // 55: agent.v1.StartActionRequest.MySQLShowIndexParams + (*StartActionRequest_PostgreSQLShowCreateTableParams)(nil), // 56: agent.v1.StartActionRequest.PostgreSQLShowCreateTableParams + (*StartActionRequest_PostgreSQLShowIndexParams)(nil), // 57: agent.v1.StartActionRequest.PostgreSQLShowIndexParams + (*StartActionRequest_MongoDBExplainParams)(nil), // 58: agent.v1.StartActionRequest.MongoDBExplainParams + (*StartActionRequest_PTSummaryParams)(nil), // 59: agent.v1.StartActionRequest.PTSummaryParams + (*StartActionRequest_PTPgSummaryParams)(nil), // 60: agent.v1.StartActionRequest.PTPgSummaryParams + (*StartActionRequest_PTMongoDBSummaryParams)(nil), // 61: agent.v1.StartActionRequest.PTMongoDBSummaryParams + (*StartActionRequest_PTMySQLSummaryParams)(nil), // 62: agent.v1.StartActionRequest.PTMySQLSummaryParams + (*StartActionRequest_MySQLQueryShowParams)(nil), // 63: agent.v1.StartActionRequest.MySQLQueryShowParams + (*StartActionRequest_MySQLQuerySelectParams)(nil), // 64: agent.v1.StartActionRequest.MySQLQuerySelectParams + (*StartActionRequest_PostgreSQLQueryShowParams)(nil), // 65: agent.v1.StartActionRequest.PostgreSQLQueryShowParams + (*StartActionRequest_PostgreSQLQuerySelectParams)(nil), // 66: agent.v1.StartActionRequest.PostgreSQLQuerySelectParams + (*StartActionRequest_MongoDBQueryGetParameterParams)(nil), // 67: agent.v1.StartActionRequest.MongoDBQueryGetParameterParams + (*StartActionRequest_MongoDBQueryBuildInfoParams)(nil), // 68: agent.v1.StartActionRequest.MongoDBQueryBuildInfoParams + (*StartActionRequest_MongoDBQueryGetCmdLineOptsParams)(nil), // 69: agent.v1.StartActionRequest.MongoDBQueryGetCmdLineOptsParams + (*StartActionRequest_MongoDBQueryReplSetGetStatusParams)(nil), // 70: agent.v1.StartActionRequest.MongoDBQueryReplSetGetStatusParams + (*StartActionRequest_MongoDBQueryGetDiagnosticDataParams)(nil), // 71: agent.v1.StartActionRequest.MongoDBQueryGetDiagnosticDataParams + (*StartActionRequest_RestartSystemServiceParams)(nil), // 72: agent.v1.StartActionRequest.RestartSystemServiceParams + (*CheckConnectionResponse_Stats)(nil), // 73: agent.v1.CheckConnectionResponse.Stats + (*StartJobRequest_MySQLBackup)(nil), // 74: agent.v1.StartJobRequest.MySQLBackup + (*StartJobRequest_MySQLRestoreBackup)(nil), // 75: agent.v1.StartJobRequest.MySQLRestoreBackup + (*StartJobRequest_MongoDBBackup)(nil), // 76: agent.v1.StartJobRequest.MongoDBBackup + (*StartJobRequest_MongoDBRestoreBackup)(nil), // 77: agent.v1.StartJobRequest.MongoDBRestoreBackup + (*JobResult_Error)(nil), // 78: agent.v1.JobResult.Error + (*JobResult_MongoDBBackup)(nil), // 79: agent.v1.JobResult.MongoDBBackup + (*JobResult_MySQLBackup)(nil), // 80: agent.v1.JobResult.MySQLBackup + (*JobResult_MySQLRestoreBackup)(nil), // 81: agent.v1.JobResult.MySQLRestoreBackup + (*JobResult_MongoDBRestoreBackup)(nil), // 82: agent.v1.JobResult.MongoDBRestoreBackup + (*JobProgress_MySQLBackup)(nil), // 83: agent.v1.JobProgress.MySQLBackup + (*JobProgress_MySQLRestoreBackup)(nil), // 84: agent.v1.JobProgress.MySQLRestoreBackup + (*JobProgress_Logs)(nil), // 85: agent.v1.JobProgress.Logs + (*GetVersionsRequest_MySQLd)(nil), // 86: agent.v1.GetVersionsRequest.MySQLd + (*GetVersionsRequest_Xtrabackup)(nil), // 87: agent.v1.GetVersionsRequest.Xtrabackup + (*GetVersionsRequest_Xbcloud)(nil), // 88: agent.v1.GetVersionsRequest.Xbcloud + (*GetVersionsRequest_Qpress)(nil), // 89: agent.v1.GetVersionsRequest.Qpress + (*GetVersionsRequest_MongoDB)(nil), // 90: agent.v1.GetVersionsRequest.MongoDB + (*GetVersionsRequest_PBM)(nil), // 91: agent.v1.GetVersionsRequest.PBM + (*GetVersionsRequest_Software)(nil), // 92: agent.v1.GetVersionsRequest.Software + (*GetVersionsResponse_Version)(nil), // 93: agent.v1.GetVersionsResponse.Version + (*timestamppb.Timestamp)(nil), // 94: google.protobuf.Timestamp + (*MetricsBucket)(nil), // 95: agent.v1.MetricsBucket + (v1.AgentStatus)(0), // 96: inventory.v1.AgentStatus + (*durationpb.Duration)(nil), // 97: google.protobuf.Duration + (v1.ServiceType)(0), // 98: inventory.v1.ServiceType + (*status.Status)(nil), // 99: google.rpc.Status + (v1.AgentType)(0), // 100: inventory.v1.AgentType + (*v1.RTAOptions)(nil), // 101: inventory.v1.RTAOptions + (v11.DataModel)(0), // 102: backup.v1.DataModel + (*v11.PbmMetadata)(nil), // 103: backup.v1.PbmMetadata + (*v11.Metadata)(nil), // 104: backup.v1.Metadata +} var file_agent_v1_agent_proto_depIdxs = []int32{ 44, // 0: agent.v1.TextFiles.files:type_name -> agent.v1.TextFiles.FilesEntry 94, // 1: agent.v1.Pong.current_time:type_name -> google.protobuf.Timestamp diff --git a/api/agent/v1/agent.pb.validate.go b/api/agent/v1/agent.pb.validate.go index 3cac3cc4faf..cfc2a1682b7 100644 --- a/api/agent/v1/agent.pb.validate.go +++ b/api/agent/v1/agent.pb.validate.go @@ -19,6 +19,7 @@ import ( "google.golang.org/protobuf/types/known/anypb" backupv1 "github.com/percona/pmm/api/backup/v1" + inventoryv1 "github.com/percona/pmm/api/inventory/v1" ) diff --git a/api/agent/v1/agent.swagger.json b/api/agent/v1/agent.swagger.json new file mode 100644 index 00000000000..9be2eb39da2 --- /dev/null +++ b/api/agent/v1/agent.swagger.json @@ -0,0 +1,55 @@ +{ + "swagger": "2.0", + "info": { + "title": "agent/v1/agent.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "AgentService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + } + }, + "additionalProperties": {}, + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]." + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client." + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + }, + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." + } + }, + "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." + } + } +} diff --git a/api/agent/v1/agent_grpc.pb.go b/api/agent/v1/agent_grpc.pb.go index 93727efa84c..d307ddcad19 100644 --- a/api/agent/v1/agent_grpc.pb.go +++ b/api/agent/v1/agent_grpc.pb.go @@ -8,7 +8,6 @@ package agentv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/agent/v1/collector.pb.go b/api/agent/v1/collector.pb.go index 4eaa7eb54a1..f1c9b64e7a9 100644 --- a/api/agent/v1/collector.pb.go +++ b/api/agent/v1/collector.pb.go @@ -7,14 +7,12 @@ package agentv1 import ( + v1 "github.com/percona/pmm/api/inventory/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -2810,23 +2808,20 @@ func file_agent_v1_collector_proto_rawDescGZIP() []byte { return file_agent_v1_collector_proto_rawDescData } -var ( - file_agent_v1_collector_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_agent_v1_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 8) - file_agent_v1_collector_proto_goTypes = []any{ - (ExampleType)(0), // 0: agent.v1.ExampleType - (*MetricsBucket)(nil), // 1: agent.v1.MetricsBucket - (*HistogramItem)(nil), // 2: agent.v1.HistogramItem - (*MetricsBucket_Common)(nil), // 3: agent.v1.MetricsBucket.Common - (*MetricsBucket_MySQL)(nil), // 4: agent.v1.MetricsBucket.MySQL - (*MetricsBucket_MongoDB)(nil), // 5: agent.v1.MetricsBucket.MongoDB - (*MetricsBucket_PostgreSQL)(nil), // 6: agent.v1.MetricsBucket.PostgreSQL - nil, // 7: agent.v1.MetricsBucket.Common.CommentsEntry - nil, // 8: agent.v1.MetricsBucket.Common.ErrorsEntry - (v1.AgentType)(0), // 9: inventory.v1.AgentType - } -) - +var file_agent_v1_collector_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_agent_v1_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_agent_v1_collector_proto_goTypes = []any{ + (ExampleType)(0), // 0: agent.v1.ExampleType + (*MetricsBucket)(nil), // 1: agent.v1.MetricsBucket + (*HistogramItem)(nil), // 2: agent.v1.HistogramItem + (*MetricsBucket_Common)(nil), // 3: agent.v1.MetricsBucket.Common + (*MetricsBucket_MySQL)(nil), // 4: agent.v1.MetricsBucket.MySQL + (*MetricsBucket_MongoDB)(nil), // 5: agent.v1.MetricsBucket.MongoDB + (*MetricsBucket_PostgreSQL)(nil), // 6: agent.v1.MetricsBucket.PostgreSQL + nil, // 7: agent.v1.MetricsBucket.Common.CommentsEntry + nil, // 8: agent.v1.MetricsBucket.Common.ErrorsEntry + (v1.AgentType)(0), // 9: inventory.v1.AgentType +} var file_agent_v1_collector_proto_depIdxs = []int32{ 3, // 0: agent.v1.MetricsBucket.common:type_name -> agent.v1.MetricsBucket.Common 4, // 1: agent.v1.MetricsBucket.mysql:type_name -> agent.v1.MetricsBucket.MySQL diff --git a/api/agent/v1/collector.swagger.json b/api/agent/v1/collector.swagger.json new file mode 100644 index 00000000000..461533c2478 --- /dev/null +++ b/api/agent/v1/collector.swagger.json @@ -0,0 +1,50 @@ +{ + "swagger": "2.0", + "info": { + "title": "agent/v1/collector.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + } + }, + "additionalProperties": {}, + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]." + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client." + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + }, + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." + } + }, + "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." + } + } +} diff --git a/api/agentlocal/v1/agentlocal.pb.go b/api/agentlocal/v1/agentlocal.pb.go index a2836f3cd3c..374821c2931 100644 --- a/api/agentlocal/v1/agentlocal.pb.go +++ b/api/agentlocal/v1/agentlocal.pb.go @@ -7,16 +7,14 @@ package agentlocalv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - + v1 "github.com/percona/pmm/api/inventory/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -244,7 +242,7 @@ func (x *StatusRequest) GetGetNetworkInfo() bool { type StatusResponse struct { state protoimpl.MessageState `protogen:"open.v1"` AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - RunsOnNodeId string `protobuf:"bytes,2,opt,name=runs_on_node_id,json=runsOnNodeId,proto3" json:"runs_on_node_id,omitempty"` // TODO: rename to node_id + RunsOnNodeId string `protobuf:"bytes,2,opt,name=runs_on_node_id,json=runsOnNodeId,proto3" json:"runs_on_node_id,omitempty"` //TODO: rename to node_id NodeName string `protobuf:"bytes,3,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` ServerInfo *ServerInfo `protobuf:"bytes,4,opt,name=server_info,json=serverInfo,proto3" json:"server_info,omitempty"` AgentsInfo []*AgentInfo `protobuf:"bytes,5,rep,name=agents_info,json=agentsInfo,proto3" json:"agents_info,omitempty"` @@ -471,21 +469,18 @@ func file_agentlocal_v1_agentlocal_proto_rawDescGZIP() []byte { return file_agentlocal_v1_agentlocal_proto_rawDescData } -var ( - file_agentlocal_v1_agentlocal_proto_msgTypes = make([]protoimpl.MessageInfo, 6) - file_agentlocal_v1_agentlocal_proto_goTypes = []any{ - (*ServerInfo)(nil), // 0: agentlocal.v1.ServerInfo - (*AgentInfo)(nil), // 1: agentlocal.v1.AgentInfo - (*StatusRequest)(nil), // 2: agentlocal.v1.StatusRequest - (*StatusResponse)(nil), // 3: agentlocal.v1.StatusResponse - (*ReloadRequest)(nil), // 4: agentlocal.v1.ReloadRequest - (*ReloadResponse)(nil), // 5: agentlocal.v1.ReloadResponse - (*durationpb.Duration)(nil), // 6: google.protobuf.Duration - (v1.AgentType)(0), // 7: inventory.v1.AgentType - (v1.AgentStatus)(0), // 8: inventory.v1.AgentStatus - } -) - +var file_agentlocal_v1_agentlocal_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_agentlocal_v1_agentlocal_proto_goTypes = []any{ + (*ServerInfo)(nil), // 0: agentlocal.v1.ServerInfo + (*AgentInfo)(nil), // 1: agentlocal.v1.AgentInfo + (*StatusRequest)(nil), // 2: agentlocal.v1.StatusRequest + (*StatusResponse)(nil), // 3: agentlocal.v1.StatusResponse + (*ReloadRequest)(nil), // 4: agentlocal.v1.ReloadRequest + (*ReloadResponse)(nil), // 5: agentlocal.v1.ReloadResponse + (*durationpb.Duration)(nil), // 6: google.protobuf.Duration + (v1.AgentType)(0), // 7: inventory.v1.AgentType + (v1.AgentStatus)(0), // 8: inventory.v1.AgentStatus +} var file_agentlocal_v1_agentlocal_proto_depIdxs = []int32{ 6, // 0: agentlocal.v1.ServerInfo.latency:type_name -> google.protobuf.Duration 6, // 1: agentlocal.v1.ServerInfo.clock_drift:type_name -> google.protobuf.Duration diff --git a/api/agentlocal/v1/agentlocal.swagger.json b/api/agentlocal/v1/agentlocal.swagger.json new file mode 100644 index 00000000000..4f22ad35a7c --- /dev/null +++ b/api/agentlocal/v1/agentlocal.swagger.json @@ -0,0 +1,295 @@ +{ + "swagger": "2.0", + "info": { + "title": "agentlocal/v1/agentlocal.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "AgentLocalService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/local/Reload": { + "post": { + "summary": "Reload reloads pmm-agent configuration.", + "operationId": "Reload", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ReloadResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ReloadRequest" + } + } + ], + "tags": [ + "AgentLocalService" + ] + } + }, + "/local/Status": { + "get": { + "summary": "Status returns current pmm-agent status.", + "operationId": "Status2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "get_network_info", + "description": "Returns network info (latency and clock_drift) if true.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "AgentLocalService" + ] + }, + "post": { + "summary": "Status returns current pmm-agent status.", + "operationId": "Status", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1StatusRequest" + } + } + ], + "tags": [ + "AgentLocalService" + ] + } + } + }, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "v1AgentInfo": { + "type": "object", + "properties": { + "agent_id": { + "type": "string" + }, + "agent_type": { + "$ref": "#/definitions/v1AgentType" + }, + "status": { + "$ref": "#/definitions/v1AgentStatus" + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "The current listen port of this Agent (exporter or vmagent).\nZero for other Agent types, or if unknown or not yet supported." + }, + "process_exec_path": { + "type": "string" + } + }, + "description": "AgentInfo contains information about Agent managed by pmm-agent." + }, + "v1AgentStatus": { + "type": "string", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ], + "default": "AGENT_STATUS_UNSPECIFIED", + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state." + }, + "v1AgentType": { + "type": "string", + "enum": [ + "AGENT_TYPE_UNSPECIFIED", + "AGENT_TYPE_PMM_AGENT", + "AGENT_TYPE_VM_AGENT", + "AGENT_TYPE_NODE_EXPORTER", + "AGENT_TYPE_MYSQLD_EXPORTER", + "AGENT_TYPE_MONGODB_EXPORTER", + "AGENT_TYPE_POSTGRES_EXPORTER", + "AGENT_TYPE_PROXYSQL_EXPORTER", + "AGENT_TYPE_VALKEY_EXPORTER", + "AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT", + "AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT", + "AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT", + "AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT", + "AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT", + "AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT", + "AGENT_TYPE_EXTERNAL_EXPORTER", + "AGENT_TYPE_RDS_EXPORTER", + "AGENT_TYPE_AZURE_DATABASE_EXPORTER", + "AGENT_TYPE_NOMAD_AGENT", + "AGENT_TYPE_RTA_MONGODB_AGENT" + ], + "default": "AGENT_TYPE_UNSPECIFIED", + "description": "AgentType describes supported Agent types." + }, + "v1ReloadRequest": { + "type": "object" + }, + "v1ReloadResponse": { + "type": "object", + "description": "ReloadRequest may not be received by the client due to pmm-agent restart." + }, + "v1ServerInfo": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "PMM Server URL in a form https://HOST:PORT/." + }, + "insecure_tls": { + "type": "boolean", + "description": "PMM Server's TLS certificate validation should be skipped if true." + }, + "connected": { + "type": "boolean", + "description": "True if pmm-agent is currently connected to the server." + }, + "version": { + "type": "string", + "description": "PMM Server version (if agent is connected)." + }, + "latency": { + "type": "string", + "description": "Ping time from pmm-agent to pmm-managed (if agent is connected)." + }, + "clock_drift": { + "type": "string", + "description": "Clock drift from PMM Server (if agent is connected)." + } + }, + "description": "ServerInfo contains information about the PMM Server." + }, + "v1StatusRequest": { + "type": "object", + "properties": { + "get_network_info": { + "type": "boolean", + "description": "Returns network info (latency and clock_drift) if true." + } + } + }, + "v1StatusResponse": { + "type": "object", + "properties": { + "agent_id": { + "type": "string" + }, + "runs_on_node_id": { + "type": "string", + "title": "TODO: rename to node_id" + }, + "node_name": { + "type": "string" + }, + "server_info": { + "$ref": "#/definitions/v1ServerInfo" + }, + "agents_info": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AgentInfo" + } + }, + "config_filepath": { + "type": "string", + "description": "Config file path if pmm-agent was started with one." + }, + "agent_version": { + "type": "string", + "description": "PMM Agent version." + }, + "connection_uptime": { + "type": "number", + "format": "float", + "title": "Shows connection uptime in percentage between agent and server" + } + } + } + } +} diff --git a/api/agentlocal/v1/agentlocal_grpc.pb.go b/api/agentlocal/v1/agentlocal_grpc.pb.go index 14d47f7c727..1b4e4c73073 100644 --- a/api/agentlocal/v1/agentlocal_grpc.pb.go +++ b/api/agentlocal/v1/agentlocal_grpc.pb.go @@ -8,7 +8,6 @@ package agentlocalv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -87,7 +86,6 @@ type UnimplementedAgentLocalServiceServer struct{} func (UnimplementedAgentLocalServiceServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { return nil, status.Error(codes.Unimplemented, "method Status not implemented") } - func (UnimplementedAgentLocalServiceServer) Reload(context.Context, *ReloadRequest) (*ReloadResponse, error) { return nil, status.Error(codes.Unimplemented, "method Reload not implemented") } diff --git a/api/alerting/v1/alerting.pb.go b/api/alerting/v1/alerting.pb.go index acd727a9865..44c388389a1 100644 --- a/api/alerting/v1/alerting.pb.go +++ b/api/alerting/v1/alerting.pb.go @@ -7,18 +7,16 @@ package alertingv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" + v1 "github.com/percona/pmm/api/management/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - v1 "github.com/percona/pmm/api/management/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -1426,40 +1424,37 @@ func file_alerting_v1_alerting_proto_rawDescGZIP() []byte { return file_alerting_v1_alerting_proto_rawDescData } -var ( - file_alerting_v1_alerting_proto_enumTypes = make([]protoimpl.EnumInfo, 2) - file_alerting_v1_alerting_proto_msgTypes = make([]protoimpl.MessageInfo, 20) - file_alerting_v1_alerting_proto_goTypes = []any{ - (TemplateSource)(0), // 0: alerting.v1.TemplateSource - (FilterType)(0), // 1: alerting.v1.FilterType - (*BoolParamDefinition)(nil), // 2: alerting.v1.BoolParamDefinition - (*FloatParamDefinition)(nil), // 3: alerting.v1.FloatParamDefinition - (*StringParamDefinition)(nil), // 4: alerting.v1.StringParamDefinition - (*ParamDefinition)(nil), // 5: alerting.v1.ParamDefinition - (*Template)(nil), // 6: alerting.v1.Template - (*ListTemplatesRequest)(nil), // 7: alerting.v1.ListTemplatesRequest - (*ListTemplatesResponse)(nil), // 8: alerting.v1.ListTemplatesResponse - (*CreateTemplateRequest)(nil), // 9: alerting.v1.CreateTemplateRequest - (*CreateTemplateResponse)(nil), // 10: alerting.v1.CreateTemplateResponse - (*UpdateTemplateRequest)(nil), // 11: alerting.v1.UpdateTemplateRequest - (*UpdateTemplateResponse)(nil), // 12: alerting.v1.UpdateTemplateResponse - (*DeleteTemplateRequest)(nil), // 13: alerting.v1.DeleteTemplateRequest - (*DeleteTemplateResponse)(nil), // 14: alerting.v1.DeleteTemplateResponse - (*Filter)(nil), // 15: alerting.v1.Filter - (*ParamValue)(nil), // 16: alerting.v1.ParamValue - (*CreateRuleRequest)(nil), // 17: alerting.v1.CreateRuleRequest - (*CreateRuleResponse)(nil), // 18: alerting.v1.CreateRuleResponse - nil, // 19: alerting.v1.Template.LabelsEntry - nil, // 20: alerting.v1.Template.AnnotationsEntry - nil, // 21: alerting.v1.CreateRuleRequest.CustomLabelsEntry - (ParamUnit)(0), // 22: alerting.v1.ParamUnit - (ParamType)(0), // 23: alerting.v1.ParamType - (*durationpb.Duration)(nil), // 24: google.protobuf.Duration - (v1.Severity)(0), // 25: management.v1.Severity - (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp - } -) - +var file_alerting_v1_alerting_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_alerting_v1_alerting_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_alerting_v1_alerting_proto_goTypes = []any{ + (TemplateSource)(0), // 0: alerting.v1.TemplateSource + (FilterType)(0), // 1: alerting.v1.FilterType + (*BoolParamDefinition)(nil), // 2: alerting.v1.BoolParamDefinition + (*FloatParamDefinition)(nil), // 3: alerting.v1.FloatParamDefinition + (*StringParamDefinition)(nil), // 4: alerting.v1.StringParamDefinition + (*ParamDefinition)(nil), // 5: alerting.v1.ParamDefinition + (*Template)(nil), // 6: alerting.v1.Template + (*ListTemplatesRequest)(nil), // 7: alerting.v1.ListTemplatesRequest + (*ListTemplatesResponse)(nil), // 8: alerting.v1.ListTemplatesResponse + (*CreateTemplateRequest)(nil), // 9: alerting.v1.CreateTemplateRequest + (*CreateTemplateResponse)(nil), // 10: alerting.v1.CreateTemplateResponse + (*UpdateTemplateRequest)(nil), // 11: alerting.v1.UpdateTemplateRequest + (*UpdateTemplateResponse)(nil), // 12: alerting.v1.UpdateTemplateResponse + (*DeleteTemplateRequest)(nil), // 13: alerting.v1.DeleteTemplateRequest + (*DeleteTemplateResponse)(nil), // 14: alerting.v1.DeleteTemplateResponse + (*Filter)(nil), // 15: alerting.v1.Filter + (*ParamValue)(nil), // 16: alerting.v1.ParamValue + (*CreateRuleRequest)(nil), // 17: alerting.v1.CreateRuleRequest + (*CreateRuleResponse)(nil), // 18: alerting.v1.CreateRuleResponse + nil, // 19: alerting.v1.Template.LabelsEntry + nil, // 20: alerting.v1.Template.AnnotationsEntry + nil, // 21: alerting.v1.CreateRuleRequest.CustomLabelsEntry + (ParamUnit)(0), // 22: alerting.v1.ParamUnit + (ParamType)(0), // 23: alerting.v1.ParamType + (*durationpb.Duration)(nil), // 24: google.protobuf.Duration + (v1.Severity)(0), // 25: management.v1.Severity + (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp +} var file_alerting_v1_alerting_proto_depIdxs = []int32{ 22, // 0: alerting.v1.ParamDefinition.unit:type_name -> alerting.v1.ParamUnit 23, // 1: alerting.v1.ParamDefinition.type:type_name -> alerting.v1.ParamType diff --git a/api/alerting/v1/alerting.pb.validate.go b/api/alerting/v1/alerting.pb.validate.go index f6a7dbcf1fa..bc3dfba5dfa 100644 --- a/api/alerting/v1/alerting.pb.validate.go +++ b/api/alerting/v1/alerting.pb.validate.go @@ -851,6 +851,7 @@ func (m *ListTemplatesRequest) validate(all bool) error { // no validation rules for Reload if m.PageSize != nil { + if m.GetPageSize() < 1 { err := ListTemplatesRequestValidationError{ field: "PageSize", @@ -861,9 +862,11 @@ func (m *ListTemplatesRequest) validate(all bool) error { } errors = append(errors, err) } + } if m.PageIndex != nil { + if m.GetPageIndex() < 0 { err := ListTemplatesRequestValidationError{ field: "PageIndex", @@ -874,6 +877,7 @@ func (m *ListTemplatesRequest) validate(all bool) error { } errors = append(errors, err) } + } if len(errors) > 0 { diff --git a/api/alerting/v1/alerting.swagger.json b/api/alerting/v1/alerting.swagger.json new file mode 100644 index 00000000000..726625709d5 --- /dev/null +++ b/api/alerting/v1/alerting.swagger.json @@ -0,0 +1,581 @@ +{ + "swagger": "2.0", + "info": { + "title": "alerting/v1/alerting.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "AlertingService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/alerting/rules": { + "post": { + "summary": "CreateRule creates alerting rule from the given template.", + "operationId": "CreateRule", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateRuleResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateRuleRequest" + } + } + ], + "tags": [ + "AlertingService" + ] + } + }, + "/v1/alerting/templates": { + "get": { + "summary": "ListTemplates returns a list of all collected alert rule templates.", + "operationId": "ListTemplates", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListTemplatesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "page_size", + "description": "Maximum number of results per page.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "page_index", + "description": "Index of the requested page, starts from 0.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "reload", + "description": "If true, template files will be re-read from disk.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "AlertingService" + ] + }, + "post": { + "summary": "CreateTemplate creates a new template.", + "operationId": "CreateTemplate", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateTemplateResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateTemplateRequest" + } + } + ], + "tags": [ + "AlertingService" + ] + } + }, + "/v1/alerting/templates/{name}": { + "delete": { + "summary": "DeleteTemplate deletes existing, previously created via API.", + "operationId": "DeleteTemplate", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DeleteTemplateResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "AlertingService" + ] + }, + "put": { + "summary": "UpdateTemplate updates existing template, previously created via API.", + "operationId": "UpdateTemplate", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateTemplateResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "name", + "description": "Machine-readable name (ID).", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AlertingServiceUpdateTemplateBody" + } + } + ], + "tags": [ + "AlertingService" + ] + } + } + }, + "definitions": { + "AlertingServiceUpdateTemplateBody": { + "type": "object", + "properties": { + "yaml": { + "type": "string", + "description": "YAML template file content." + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1BoolParamDefinition": { + "type": "object", + "properties": { + "default": { + "type": "boolean", + "x-nullable": true + } + }, + "description": "BoolParamDefinition represents boolean parameter's default value." + }, + "v1CreateRuleRequest": { + "type": "object", + "properties": { + "template_name": { + "type": "string", + "description": "Template name." + }, + "name": { + "type": "string", + "description": "Rule name." + }, + "group": { + "type": "string", + "description": "Rule group name." + }, + "folder_uid": { + "type": "string", + "description": "Folder UID." + }, + "params": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ParamValue" + }, + "description": "Rule parameters. All template parameters should be set." + }, + "for": { + "type": "string", + "description": "Rule duration. Should be set." + }, + "severity": { + "$ref": "#/definitions/v1Severity", + "description": "Rule severity. Should be set." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "All custom labels to add or remove (with empty values) to default labels from template." + }, + "filters": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Filter" + }, + "description": "Filters." + }, + "interval": { + "type": "string", + "title": "Evaluation Interval" + } + } + }, + "v1CreateRuleResponse": { + "type": "object" + }, + "v1CreateTemplateRequest": { + "type": "object", + "properties": { + "yaml": { + "type": "string", + "description": "YAML template file content." + } + } + }, + "v1CreateTemplateResponse": { + "type": "object" + }, + "v1DeleteTemplateResponse": { + "type": "object" + }, + "v1Filter": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/v1FilterType" + }, + "label": { + "type": "string" + }, + "regexp": { + "type": "string" + } + }, + "description": "Filter represents a single filter condition." + }, + "v1FilterType": { + "type": "string", + "enum": [ + "FILTER_TYPE_UNSPECIFIED", + "FILTER_TYPE_MATCH", + "FILTER_TYPE_MISMATCH" + ], + "default": "FILTER_TYPE_UNSPECIFIED", + "description": "FilterType represents filter matching type." + }, + "v1FloatParamDefinition": { + "type": "object", + "properties": { + "default": { + "type": "number", + "format": "double", + "x-nullable": true, + "description": "Default value." + }, + "min": { + "type": "number", + "format": "double", + "x-nullable": true, + "description": "Minimum valid value (inclusive)." + }, + "max": { + "type": "number", + "format": "double", + "x-nullable": true, + "description": "Maximum valid value (inclusive)." + } + }, + "description": "FloatParamDefinition represents float parameter's default value and valid range." + }, + "v1ListTemplatesResponse": { + "type": "object", + "properties": { + "total_items": { + "type": "integer", + "format": "int32", + "description": "Total number of results." + }, + "total_pages": { + "type": "integer", + "format": "int32", + "description": "Total number of pages." + }, + "templates": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Template" + }, + "description": "Alerting templates." + } + } + }, + "v1ParamDefinition": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Machine-readable name (ID) that is used in expression." + }, + "summary": { + "type": "string", + "description": "Short human-readable parameter summary." + }, + "unit": { + "$ref": "#/definitions/v1ParamUnit", + "description": "Parameter unit. TODO: remove this parameter." + }, + "type": { + "$ref": "#/definitions/v1ParamType", + "description": "Parameter type." + }, + "bool": { + "$ref": "#/definitions/v1BoolParamDefinition", + "description": "Bool value." + }, + "float": { + "$ref": "#/definitions/v1FloatParamDefinition", + "description": "Float value." + }, + "string": { + "$ref": "#/definitions/v1StringParamDefinition", + "description": "String value." + } + }, + "description": "ParamDefinition represents a single query parameter." + }, + "v1ParamType": { + "type": "string", + "enum": [ + "PARAM_TYPE_UNSPECIFIED", + "PARAM_TYPE_BOOL", + "PARAM_TYPE_FLOAT", + "PARAM_TYPE_STRING" + ], + "default": "PARAM_TYPE_UNSPECIFIED", + "description": "ParamType represents template parameter type." + }, + "v1ParamUnit": { + "type": "string", + "enum": [ + "PARAM_UNIT_UNSPECIFIED", + "PARAM_UNIT_PERCENTAGE", + "PARAM_UNIT_SECONDS" + ], + "default": "PARAM_UNIT_UNSPECIFIED", + "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_UNSPECIFIED: Invalid, unknown or absent.\n - PARAM_UNIT_PERCENTAGE: %\n - PARAM_UNIT_SECONDS: s" + }, + "v1ParamValue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Machine-readable name (ID) that is used in expression." + }, + "type": { + "$ref": "#/definitions/v1ParamType", + "description": "Parameter type." + }, + "bool": { + "type": "boolean", + "description": "Bool value." + }, + "float": { + "type": "number", + "format": "double", + "description": "Float value." + }, + "string": { + "type": "string", + "description": "String value." + } + }, + "description": "ParamValue represents a single rule parameter value." + }, + "v1Severity": { + "type": "string", + "enum": [ + "SEVERITY_UNSPECIFIED", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ], + "default": "SEVERITY_UNSPECIFIED", + "description": "Severity represents severity level of the check result or alert." + }, + "v1StringParamDefinition": { + "type": "object", + "properties": { + "default": { + "type": "string", + "x-nullable": true, + "description": "Default value." + } + }, + "description": "StringParamDefinition represents string parameter's default value." + }, + "v1Template": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Machine-readable name (ID)." + }, + "summary": { + "type": "string", + "description": "Short human-readable summary." + }, + "expr": { + "type": "string", + "description": "PromQL query expression with templating parameters." + }, + "params": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ParamDefinition" + }, + "description": "Query parameters definitions." + }, + "for": { + "type": "string", + "description": "Default duration value." + }, + "severity": { + "$ref": "#/definitions/v1Severity", + "description": "Severity." + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Labels." + }, + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Annotations." + }, + "source": { + "$ref": "#/definitions/v1TemplateSource", + "description": "Template source. Only templates created via API can be updated or deleted via API." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Template creation time. Empty for built-in and SaaS templates." + }, + "yaml": { + "type": "string", + "description": "YAML template file content. Empty for built-in and SaaS templates." + } + }, + "description": "Template represents Alert Template that is used to create Alert Rule." + }, + "v1TemplateSource": { + "type": "string", + "enum": [ + "TEMPLATE_SOURCE_UNSPECIFIED", + "TEMPLATE_SOURCE_BUILT_IN", + "TEMPLATE_SOURCE_SAAS", + "TEMPLATE_SOURCE_USER_FILE", + "TEMPLATE_SOURCE_USER_API" + ], + "default": "TEMPLATE_SOURCE_UNSPECIFIED", + "description": "TemplateSource defines template source.\n\n - TEMPLATE_SOURCE_BUILT_IN: Template that is shipped with PMM Server releases.\n - TEMPLATE_SOURCE_SAAS: Template that is downloaded from check.percona.com.\n - TEMPLATE_SOURCE_USER_FILE: Templated loaded from user-suplied file.\n - TEMPLATE_SOURCE_USER_API: Templated created via API." + }, + "v1UpdateTemplateResponse": { + "type": "object" + } + } +} diff --git a/api/alerting/v1/alerting_grpc.pb.go b/api/alerting/v1/alerting_grpc.pb.go index d559dc19bfe..1db7fdf68b9 100644 --- a/api/alerting/v1/alerting_grpc.pb.go +++ b/api/alerting/v1/alerting_grpc.pb.go @@ -8,7 +8,6 @@ package alertingv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -132,19 +131,15 @@ type UnimplementedAlertingServiceServer struct{} func (UnimplementedAlertingServiceServer) ListTemplates(context.Context, *ListTemplatesRequest) (*ListTemplatesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListTemplates not implemented") } - func (UnimplementedAlertingServiceServer) CreateTemplate(context.Context, *CreateTemplateRequest) (*CreateTemplateResponse, error) { return nil, status.Error(codes.Unimplemented, "method CreateTemplate not implemented") } - func (UnimplementedAlertingServiceServer) UpdateTemplate(context.Context, *UpdateTemplateRequest) (*UpdateTemplateResponse, error) { return nil, status.Error(codes.Unimplemented, "method UpdateTemplate not implemented") } - func (UnimplementedAlertingServiceServer) DeleteTemplate(context.Context, *DeleteTemplateRequest) (*DeleteTemplateResponse, error) { return nil, status.Error(codes.Unimplemented, "method DeleteTemplate not implemented") } - func (UnimplementedAlertingServiceServer) CreateRule(context.Context, *CreateRuleRequest) (*CreateRuleResponse, error) { return nil, status.Error(codes.Unimplemented, "method CreateRule not implemented") } diff --git a/api/alerting/v1/params.pb.go b/api/alerting/v1/params.pb.go index 5df5a859b29..4f9034616f4 100644 --- a/api/alerting/v1/params.pb.go +++ b/api/alerting/v1/params.pb.go @@ -7,12 +7,11 @@ package alertingv1 import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -156,14 +155,11 @@ func file_alerting_v1_params_proto_rawDescGZIP() []byte { return file_alerting_v1_params_proto_rawDescData } -var ( - file_alerting_v1_params_proto_enumTypes = make([]protoimpl.EnumInfo, 2) - file_alerting_v1_params_proto_goTypes = []any{ - (ParamUnit)(0), // 0: alerting.v1.ParamUnit - (ParamType)(0), // 1: alerting.v1.ParamType - } -) - +var file_alerting_v1_params_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_alerting_v1_params_proto_goTypes = []any{ + (ParamUnit)(0), // 0: alerting.v1.ParamUnit + (ParamType)(0), // 1: alerting.v1.ParamType +} var file_alerting_v1_params_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/alerting/v1/params.swagger.json b/api/alerting/v1/params.swagger.json new file mode 100644 index 00000000000..d56f9a7c05a --- /dev/null +++ b/api/alerting/v1/params.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "alerting/v1/params.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/backup/v1/artifacts.pb.go b/api/backup/v1/artifacts.pb.go index 5302152bd21..a921d234e96 100644 --- a/api/backup/v1/artifacts.pb.go +++ b/api/backup/v1/artifacts.pb.go @@ -7,14 +7,13 @@ package backupv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -637,26 +636,23 @@ func file_backup_v1_artifacts_proto_rawDescGZIP() []byte { return file_backup_v1_artifacts_proto_rawDescData } -var ( - file_backup_v1_artifacts_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_backup_v1_artifacts_proto_msgTypes = make([]protoimpl.MessageInfo, 8) - file_backup_v1_artifacts_proto_goTypes = []any{ - (BackupStatus)(0), // 0: backup.v1.BackupStatus - (*Artifact)(nil), // 1: backup.v1.Artifact - (*ListArtifactsRequest)(nil), // 2: backup.v1.ListArtifactsRequest - (*ListArtifactsResponse)(nil), // 3: backup.v1.ListArtifactsResponse - (*DeleteArtifactRequest)(nil), // 4: backup.v1.DeleteArtifactRequest - (*DeleteArtifactResponse)(nil), // 5: backup.v1.DeleteArtifactResponse - (*PitrTimerange)(nil), // 6: backup.v1.PitrTimerange - (*ListPitrTimerangesRequest)(nil), // 7: backup.v1.ListPitrTimerangesRequest - (*ListPitrTimerangesResponse)(nil), // 8: backup.v1.ListPitrTimerangesResponse - (DataModel)(0), // 9: backup.v1.DataModel - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp - (BackupMode)(0), // 11: backup.v1.BackupMode - (*Metadata)(nil), // 12: backup.v1.Metadata - } -) - +var file_backup_v1_artifacts_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_backup_v1_artifacts_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_backup_v1_artifacts_proto_goTypes = []any{ + (BackupStatus)(0), // 0: backup.v1.BackupStatus + (*Artifact)(nil), // 1: backup.v1.Artifact + (*ListArtifactsRequest)(nil), // 2: backup.v1.ListArtifactsRequest + (*ListArtifactsResponse)(nil), // 3: backup.v1.ListArtifactsResponse + (*DeleteArtifactRequest)(nil), // 4: backup.v1.DeleteArtifactRequest + (*DeleteArtifactResponse)(nil), // 5: backup.v1.DeleteArtifactResponse + (*PitrTimerange)(nil), // 6: backup.v1.PitrTimerange + (*ListPitrTimerangesRequest)(nil), // 7: backup.v1.ListPitrTimerangesRequest + (*ListPitrTimerangesResponse)(nil), // 8: backup.v1.ListPitrTimerangesResponse + (DataModel)(0), // 9: backup.v1.DataModel + (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp + (BackupMode)(0), // 11: backup.v1.BackupMode + (*Metadata)(nil), // 12: backup.v1.Metadata +} var file_backup_v1_artifacts_proto_depIdxs = []int32{ 9, // 0: backup.v1.Artifact.data_model:type_name -> backup.v1.DataModel 0, // 1: backup.v1.Artifact.status:type_name -> backup.v1.BackupStatus diff --git a/api/backup/v1/artifacts.swagger.json b/api/backup/v1/artifacts.swagger.json new file mode 100644 index 00000000000..c160f10d3e5 --- /dev/null +++ b/api/backup/v1/artifacts.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "backup/v1/artifacts.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/backup/v1/backup.pb.go b/api/backup/v1/backup.pb.go index 36a2ec0efb4..f358db0246e 100644 --- a/api/backup/v1/backup.pb.go +++ b/api/backup/v1/backup.pb.go @@ -7,19 +7,17 @@ package backupv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + v1 "github.com/percona/pmm/api/inventory/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -1243,40 +1241,37 @@ func file_backup_v1_backup_proto_rawDescGZIP() []byte { return file_backup_v1_backup_proto_rawDescData } -var ( - file_backup_v1_backup_proto_msgTypes = make([]protoimpl.MessageInfo, 15) - file_backup_v1_backup_proto_goTypes = []any{ - (*StartBackupRequest)(nil), // 0: backup.v1.StartBackupRequest - (*StartBackupResponse)(nil), // 1: backup.v1.StartBackupResponse - (*ListArtifactCompatibleServicesRequest)(nil), // 2: backup.v1.ListArtifactCompatibleServicesRequest - (*ListArtifactCompatibleServicesResponse)(nil), // 3: backup.v1.ListArtifactCompatibleServicesResponse - (*ScheduledBackup)(nil), // 4: backup.v1.ScheduledBackup - (*ScheduleBackupRequest)(nil), // 5: backup.v1.ScheduleBackupRequest - (*ScheduleBackupResponse)(nil), // 6: backup.v1.ScheduleBackupResponse - (*ListScheduledBackupsRequest)(nil), // 7: backup.v1.ListScheduledBackupsRequest - (*ListScheduledBackupsResponse)(nil), // 8: backup.v1.ListScheduledBackupsResponse - (*ChangeScheduledBackupRequest)(nil), // 9: backup.v1.ChangeScheduledBackupRequest - (*ChangeScheduledBackupResponse)(nil), // 10: backup.v1.ChangeScheduledBackupResponse - (*RemoveScheduledBackupRequest)(nil), // 11: backup.v1.RemoveScheduledBackupRequest - (*RemoveScheduledBackupResponse)(nil), // 12: backup.v1.RemoveScheduledBackupResponse - (*GetLogsRequest)(nil), // 13: backup.v1.GetLogsRequest - (*GetLogsResponse)(nil), // 14: backup.v1.GetLogsResponse - (*durationpb.Duration)(nil), // 15: google.protobuf.Duration - (DataModel)(0), // 16: backup.v1.DataModel - (*v1.MySQLService)(nil), // 17: inventory.v1.MySQLService - (*v1.MongoDBService)(nil), // 18: inventory.v1.MongoDBService - (*timestamppb.Timestamp)(nil), // 19: google.protobuf.Timestamp - (BackupMode)(0), // 20: backup.v1.BackupMode - (*LogChunk)(nil), // 21: backup.v1.LogChunk - (*ListArtifactsRequest)(nil), // 22: backup.v1.ListArtifactsRequest - (*DeleteArtifactRequest)(nil), // 23: backup.v1.DeleteArtifactRequest - (*ListPitrTimerangesRequest)(nil), // 24: backup.v1.ListPitrTimerangesRequest - (*ListArtifactsResponse)(nil), // 25: backup.v1.ListArtifactsResponse - (*DeleteArtifactResponse)(nil), // 26: backup.v1.DeleteArtifactResponse - (*ListPitrTimerangesResponse)(nil), // 27: backup.v1.ListPitrTimerangesResponse - } -) - +var file_backup_v1_backup_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_backup_v1_backup_proto_goTypes = []any{ + (*StartBackupRequest)(nil), // 0: backup.v1.StartBackupRequest + (*StartBackupResponse)(nil), // 1: backup.v1.StartBackupResponse + (*ListArtifactCompatibleServicesRequest)(nil), // 2: backup.v1.ListArtifactCompatibleServicesRequest + (*ListArtifactCompatibleServicesResponse)(nil), // 3: backup.v1.ListArtifactCompatibleServicesResponse + (*ScheduledBackup)(nil), // 4: backup.v1.ScheduledBackup + (*ScheduleBackupRequest)(nil), // 5: backup.v1.ScheduleBackupRequest + (*ScheduleBackupResponse)(nil), // 6: backup.v1.ScheduleBackupResponse + (*ListScheduledBackupsRequest)(nil), // 7: backup.v1.ListScheduledBackupsRequest + (*ListScheduledBackupsResponse)(nil), // 8: backup.v1.ListScheduledBackupsResponse + (*ChangeScheduledBackupRequest)(nil), // 9: backup.v1.ChangeScheduledBackupRequest + (*ChangeScheduledBackupResponse)(nil), // 10: backup.v1.ChangeScheduledBackupResponse + (*RemoveScheduledBackupRequest)(nil), // 11: backup.v1.RemoveScheduledBackupRequest + (*RemoveScheduledBackupResponse)(nil), // 12: backup.v1.RemoveScheduledBackupResponse + (*GetLogsRequest)(nil), // 13: backup.v1.GetLogsRequest + (*GetLogsResponse)(nil), // 14: backup.v1.GetLogsResponse + (*durationpb.Duration)(nil), // 15: google.protobuf.Duration + (DataModel)(0), // 16: backup.v1.DataModel + (*v1.MySQLService)(nil), // 17: inventory.v1.MySQLService + (*v1.MongoDBService)(nil), // 18: inventory.v1.MongoDBService + (*timestamppb.Timestamp)(nil), // 19: google.protobuf.Timestamp + (BackupMode)(0), // 20: backup.v1.BackupMode + (*LogChunk)(nil), // 21: backup.v1.LogChunk + (*ListArtifactsRequest)(nil), // 22: backup.v1.ListArtifactsRequest + (*DeleteArtifactRequest)(nil), // 23: backup.v1.DeleteArtifactRequest + (*ListPitrTimerangesRequest)(nil), // 24: backup.v1.ListPitrTimerangesRequest + (*ListArtifactsResponse)(nil), // 25: backup.v1.ListArtifactsResponse + (*DeleteArtifactResponse)(nil), // 26: backup.v1.DeleteArtifactResponse + (*ListPitrTimerangesResponse)(nil), // 27: backup.v1.ListPitrTimerangesResponse +} var file_backup_v1_backup_proto_depIdxs = []int32{ 15, // 0: backup.v1.StartBackupRequest.retry_interval:type_name -> google.protobuf.Duration 16, // 1: backup.v1.StartBackupRequest.data_model:type_name -> backup.v1.DataModel diff --git a/api/backup/v1/backup.swagger.json b/api/backup/v1/backup.swagger.json new file mode 100644 index 00000000000..084b996bce7 --- /dev/null +++ b/api/backup/v1/backup.swagger.json @@ -0,0 +1,1003 @@ +{ + "swagger": "2.0", + "info": { + "title": "backup/v1/backup.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "BackupService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/backups/artifacts": { + "get": { + "summary": "List artifacts", + "description": "Return a list of backup artifacts.", + "operationId": "ListArtifacts", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListArtifactsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "BackupService" + ] + } + }, + "/v1/backups/artifacts/{artifact_id}": { + "delete": { + "summary": "Delete Artifact", + "description": "Deletes an artifact.", + "operationId": "DeleteArtifact", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DeleteArtifactResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "artifact_id", + "description": "Machine-readable artifact ID.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "remove_files", + "description": "Removes all the backup files associated with artifact if flag is set.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "BackupService" + ] + } + }, + "/v1/backups/artifacts/{artifact_id}/pitr-timeranges": { + "get": { + "summary": "List PITR Timeranges", + "description": "Return a list of available MongoDB point-in-time-recovery timeranges.", + "operationId": "ListPitrTimeranges", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListPitrTimerangesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "artifact_id", + "description": "Artifact ID represents artifact whose location has PITR timeranges to be retrieved.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "BackupService" + ] + } + }, + "/v1/backups/scheduled": { + "get": { + "summary": "List Scheduled Backups", + "description": "List all scheduled backups.", + "operationId": "ListScheduledBackups", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListScheduledBackupsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "BackupService" + ] + } + }, + "/v1/backups/{artifact_id}/compatible-services": { + "get": { + "summary": "List Compatible Services", + "description": "List services that are compatible with the backup artifact.", + "operationId": "ListArtifactCompatibleServices", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListArtifactCompatibleServicesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "artifact_id", + "description": "Artifact id used to determine restore compatibility.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "BackupService" + ] + } + }, + "/v1/backups/{artifact_id}/logs": { + "get": { + "summary": "Get Logs", + "description": "Get logs from the underlying tools for a backup/restore job.", + "operationId": "GetLogs", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetLogsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "artifact_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "offset", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "name": "limit", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "BackupService" + ] + } + }, + "/v1/backups/{scheduled_backup_id}": { + "delete": { + "summary": "Remove a Scheduled Backup", + "description": "Remove a scheduled backup.", + "operationId": "RemoveScheduledBackup", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RemoveScheduledBackupResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "scheduled_backup_id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "BackupService" + ] + } + }, + "/v1/backups:changeScheduled": { + "put": { + "summary": "Change a Scheduled Backup", + "description": "Change a scheduled backup.", + "operationId": "ChangeScheduledBackup", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ChangeScheduledBackupResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ChangeScheduledBackupRequest" + } + } + ], + "tags": [ + "BackupService" + ] + } + }, + "/v1/backups:schedule": { + "post": { + "summary": "Schedule a Backup", + "description": "Schedule a backup to run at a specified time.", + "operationId": "ScheduleBackup", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ScheduleBackupResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ScheduleBackupRequest" + } + } + ], + "tags": [ + "BackupService" + ] + } + }, + "/v1/backups:start": { + "post": { + "summary": "Start a Backup", + "description": "Could return the Error message in the details containing specific ErrorCode indicating failure reason:\nERROR_CODE_XTRABACKUP_NOT_INSTALLED - xtrabackup is not installed on the service\nERROR_CODE_INVALID_XTRABACKUP - different versions of xtrabackup and xbcloud\nERROR_CODE_INCOMPATIBLE_XTRABACKUP - xtrabackup is not compatible with MySQL for taking a backup", + "operationId": "StartBackup", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StartBackupResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1StartBackupRequest" + } + } + ], + "tags": [ + "BackupService" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1Artifact": { + "type": "object", + "properties": { + "artifact_id": { + "type": "string", + "description": "Machine-readable artifact ID." + }, + "name": { + "type": "string", + "title": "Artifact name" + }, + "vendor": { + "type": "string", + "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL." + }, + "location_id": { + "type": "string", + "description": "Machine-readable location ID." + }, + "location_name": { + "type": "string", + "description": "Location name." + }, + "service_id": { + "type": "string", + "description": "Machine-readable service ID." + }, + "service_name": { + "type": "string", + "description": "Service name." + }, + "data_model": { + "$ref": "#/definitions/v1DataModel", + "description": "Backup data model." + }, + "status": { + "$ref": "#/definitions/v1BackupStatus", + "description": "Backup status." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Artifact creation time." + }, + "mode": { + "$ref": "#/definitions/v1BackupMode", + "description": "Backup mode." + }, + "is_sharded_cluster": { + "type": "boolean", + "description": "Source database setup type." + }, + "folder": { + "type": "string", + "description": "Folder to store artifact on a storage." + }, + "metadata_list": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Metadata" + }, + "description": "List of artifact metadata." + } + }, + "description": "Artifact represents single backup artifact." + }, + "v1BackupMode": { + "type": "string", + "enum": [ + "BACKUP_MODE_UNSPECIFIED", + "BACKUP_MODE_SNAPSHOT", + "BACKUP_MODE_INCREMENTAL", + "BACKUP_MODE_PITR" + ], + "default": "BACKUP_MODE_UNSPECIFIED", + "description": "BackupMode specifies backup mode." + }, + "v1BackupStatus": { + "type": "string", + "enum": [ + "BACKUP_STATUS_UNSPECIFIED", + "BACKUP_STATUS_PENDING", + "BACKUP_STATUS_IN_PROGRESS", + "BACKUP_STATUS_PAUSED", + "BACKUP_STATUS_SUCCESS", + "BACKUP_STATUS_ERROR", + "BACKUP_STATUS_DELETING", + "BACKUP_STATUS_FAILED_TO_DELETE", + "BACKUP_STATUS_CLEANUP_IN_PROGRESS" + ], + "default": "BACKUP_STATUS_UNSPECIFIED", + "description": "BackupStatus shows the current status of execution of backup." + }, + "v1ChangeScheduledBackupRequest": { + "type": "object", + "properties": { + "scheduled_backup_id": { + "type": "string" + }, + "enabled": { + "type": "boolean", + "x-nullable": true + }, + "cron_expression": { + "type": "string", + "x-nullable": true, + "description": "How often backup should be run in cron format." + }, + "start_time": { + "type": "string", + "format": "date-time", + "description": "First backup wouldn't happen before this time." + }, + "name": { + "type": "string", + "x-nullable": true, + "description": "Name of backup." + }, + "description": { + "type": "string", + "x-nullable": true, + "description": "Human-readable description." + }, + "retries": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "description": "How many times to retry a failed backup before giving up." + }, + "retry_interval": { + "type": "string", + "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h." + }, + "retention": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "description": "How many artifacts keep. 0 - unlimited." + } + } + }, + "v1ChangeScheduledBackupResponse": { + "type": "object" + }, + "v1DataModel": { + "type": "string", + "enum": [ + "DATA_MODEL_UNSPECIFIED", + "DATA_MODEL_PHYSICAL", + "DATA_MODEL_LOGICAL" + ], + "default": "DATA_MODEL_UNSPECIFIED", + "description": "DataModel is a model used for performing a backup." + }, + "v1DeleteArtifactResponse": { + "type": "object" + }, + "v1File": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "is_directory": { + "type": "boolean" + } + }, + "description": "File represents file or folder on a storage." + }, + "v1GetLogsResponse": { + "type": "object", + "properties": { + "logs": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1LogChunk" + } + }, + "end": { + "type": "boolean" + } + } + }, + "v1ListArtifactCompatibleServicesResponse": { + "type": "object", + "properties": { + "mysql": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1MySQLService" + } + }, + "mongodb": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1MongoDBService" + } + } + } + }, + "v1ListArtifactsResponse": { + "type": "object", + "properties": { + "artifacts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Artifact" + } + } + } + }, + "v1ListPitrTimerangesResponse": { + "type": "object", + "properties": { + "timeranges": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PitrTimerange" + } + } + } + }, + "v1ListScheduledBackupsResponse": { + "type": "object", + "properties": { + "scheduled_backups": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ScheduledBackup" + } + } + } + }, + "v1LogChunk": { + "type": "object", + "properties": { + "chunk_id": { + "type": "integer", + "format": "int64" + }, + "data": { + "type": "string" + } + }, + "description": "LogChunk represent one chunk of logs." + }, + "v1Metadata": { + "type": "object", + "properties": { + "file_list": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1File" + }, + "description": "List of files backup consists of." + }, + "restore_to": { + "type": "string", + "format": "date-time", + "description": "Exact time DB can be restored to." + }, + "pbm_metadata": { + "$ref": "#/definitions/v1PbmMetadata" + } + }, + "description": "Metadata contains extra artifact data like files it consists of, tool specific data, etc." + }, + "v1MongoDBService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "version": { + "type": "string", + "description": "MongoDB version." + } + }, + "description": "MongoDBService represents a generic MongoDB instance." + }, + "v1MySQLService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "version": { + "type": "string", + "description": "MySQL version." + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra parameters to be added to the DSN." + } + }, + "description": "MySQLService represents a generic MySQL instance." + }, + "v1PbmMetadata": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of backup in backup tool representation." + } + }, + "description": "PbmMetadata contains additional data for pbm cli tools." + }, + "v1PitrTimerange": { + "type": "object", + "properties": { + "start_timestamp": { + "type": "string", + "format": "date-time", + "description": "start_timestamp is the time of the first event in the PITR chunk." + }, + "end_timestamp": { + "type": "string", + "format": "date-time", + "description": "end_timestamp is the time of the last event in the PITR chunk." + } + } + }, + "v1RemoveScheduledBackupResponse": { + "type": "object" + }, + "v1ScheduleBackupRequest": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Service identifier where backup should be performed." + }, + "location_id": { + "type": "string", + "description": "Machine-readable location ID." + }, + "folder": { + "type": "string", + "description": "How often backup should be run in cron format.\nFolder on storage for artifact." + }, + "cron_expression": { + "type": "string" + }, + "start_time": { + "type": "string", + "format": "date-time", + "description": "First backup wouldn't happen before this time." + }, + "name": { + "type": "string", + "description": "Name of backup." + }, + "description": { + "type": "string", + "description": "Human-readable description." + }, + "enabled": { + "type": "boolean", + "description": "If scheduling is enabled." + }, + "retries": { + "type": "integer", + "format": "int64", + "description": "How many times to retry a failed backup before giving up." + }, + "retry_interval": { + "type": "string", + "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h." + }, + "mode": { + "$ref": "#/definitions/v1BackupMode", + "description": "Backup mode." + }, + "data_model": { + "$ref": "#/definitions/v1DataModel", + "description": "Backup data model (physical or logical)." + }, + "retention": { + "type": "integer", + "format": "int64", + "description": "How many artifacts keep. 0 - unlimited." + } + } + }, + "v1ScheduleBackupResponse": { + "type": "object", + "properties": { + "scheduled_backup_id": { + "type": "string" + } + } + }, + "v1ScheduledBackup": { + "type": "object", + "properties": { + "scheduled_backup_id": { + "type": "string", + "description": "Machine-readable ID." + }, + "service_id": { + "type": "string", + "description": "Machine-readable service ID." + }, + "service_name": { + "type": "string", + "description": "Service name." + }, + "location_id": { + "type": "string", + "description": "Machine-readable location ID." + }, + "location_name": { + "type": "string", + "description": "Location name." + }, + "folder": { + "type": "string", + "description": "Folder on storage for artifact." + }, + "cron_expression": { + "type": "string", + "description": "How often backup will be run in cron format." + }, + "start_time": { + "type": "string", + "format": "date-time", + "description": "First backup wouldn't happen before this time." + }, + "name": { + "type": "string", + "description": "Artifact name." + }, + "description": { + "type": "string", + "description": "Description." + }, + "enabled": { + "type": "boolean", + "description": "If scheduling is enabled." + }, + "retries": { + "type": "integer", + "format": "int64", + "description": "How many times to retry a failed backup before giving up." + }, + "retry_interval": { + "type": "string", + "description": "Delay between each retry. Should have a suffix in JSON: 2s, 1m, 1h." + }, + "data_model": { + "$ref": "#/definitions/v1DataModel", + "description": "Backup data model (physical or logical)." + }, + "mode": { + "$ref": "#/definitions/v1BackupMode", + "description": "Backup mode." + }, + "vendor": { + "type": "string", + "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL." + }, + "last_run": { + "type": "string", + "format": "date-time", + "description": "Last run." + }, + "next_run": { + "type": "string", + "format": "date-time", + "description": "Next run." + }, + "retention": { + "type": "integer", + "format": "int64", + "description": "How many artifacts keep. 0 - unlimited." + } + }, + "description": "ScheduledBackup represents scheduled task for backup." + }, + "v1StartBackupRequest": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "location_id": { + "type": "string", + "description": "Machine-readable location ID." + }, + "name": { + "type": "string", + "description": "If empty then name is auto-generated." + }, + "description": { + "type": "string", + "description": "Human-readable description." + }, + "retry_interval": { + "type": "string", + "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h." + }, + "retries": { + "type": "integer", + "format": "int64", + "description": "How many times to retry a failed backup before giving up." + }, + "data_model": { + "$ref": "#/definitions/v1DataModel", + "description": "DataModel represents the data model used for the backup." + }, + "folder": { + "type": "string", + "description": "Folder on storage for artifact." + } + } + }, + "v1StartBackupResponse": { + "type": "object", + "properties": { + "artifact_id": { + "type": "string", + "description": "Unique identifier." + } + } + } + } +} diff --git a/api/backup/v1/backup_grpc.pb.go b/api/backup/v1/backup_grpc.pb.go index 2f28a3ab987..6d16ad2b7de 100644 --- a/api/backup/v1/backup_grpc.pb.go +++ b/api/backup/v1/backup_grpc.pb.go @@ -8,7 +8,6 @@ package backupv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -207,39 +206,30 @@ type UnimplementedBackupServiceServer struct{} func (UnimplementedBackupServiceServer) StartBackup(context.Context, *StartBackupRequest) (*StartBackupResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartBackup not implemented") } - func (UnimplementedBackupServiceServer) ListArtifactCompatibleServices(context.Context, *ListArtifactCompatibleServicesRequest) (*ListArtifactCompatibleServicesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListArtifactCompatibleServices not implemented") } - func (UnimplementedBackupServiceServer) ScheduleBackup(context.Context, *ScheduleBackupRequest) (*ScheduleBackupResponse, error) { return nil, status.Error(codes.Unimplemented, "method ScheduleBackup not implemented") } - func (UnimplementedBackupServiceServer) ListScheduledBackups(context.Context, *ListScheduledBackupsRequest) (*ListScheduledBackupsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListScheduledBackups not implemented") } - func (UnimplementedBackupServiceServer) ChangeScheduledBackup(context.Context, *ChangeScheduledBackupRequest) (*ChangeScheduledBackupResponse, error) { return nil, status.Error(codes.Unimplemented, "method ChangeScheduledBackup not implemented") } - func (UnimplementedBackupServiceServer) RemoveScheduledBackup(context.Context, *RemoveScheduledBackupRequest) (*RemoveScheduledBackupResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveScheduledBackup not implemented") } - func (UnimplementedBackupServiceServer) GetLogs(context.Context, *GetLogsRequest) (*GetLogsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetLogs not implemented") } - func (UnimplementedBackupServiceServer) ListArtifacts(context.Context, *ListArtifactsRequest) (*ListArtifactsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListArtifacts not implemented") } - func (UnimplementedBackupServiceServer) DeleteArtifact(context.Context, *DeleteArtifactRequest) (*DeleteArtifactResponse, error) { return nil, status.Error(codes.Unimplemented, "method DeleteArtifact not implemented") } - func (UnimplementedBackupServiceServer) ListPitrTimeranges(context.Context, *ListPitrTimerangesRequest) (*ListPitrTimerangesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListPitrTimeranges not implemented") } diff --git a/api/backup/v1/common.pb.go b/api/backup/v1/common.pb.go index ca4ba8be172..da7f4a0678c 100644 --- a/api/backup/v1/common.pb.go +++ b/api/backup/v1/common.pb.go @@ -7,14 +7,13 @@ package backupv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -410,20 +409,17 @@ func file_backup_v1_common_proto_rawDescGZIP() []byte { return file_backup_v1_common_proto_rawDescData } -var ( - file_backup_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) - file_backup_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 4) - file_backup_v1_common_proto_goTypes = []any{ - (DataModel)(0), // 0: backup.v1.DataModel - (BackupMode)(0), // 1: backup.v1.BackupMode - (*File)(nil), // 2: backup.v1.File - (*PbmMetadata)(nil), // 3: backup.v1.PbmMetadata - (*Metadata)(nil), // 4: backup.v1.Metadata - (*LogChunk)(nil), // 5: backup.v1.LogChunk - (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp - } -) - +var file_backup_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_backup_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_backup_v1_common_proto_goTypes = []any{ + (DataModel)(0), // 0: backup.v1.DataModel + (BackupMode)(0), // 1: backup.v1.BackupMode + (*File)(nil), // 2: backup.v1.File + (*PbmMetadata)(nil), // 3: backup.v1.PbmMetadata + (*Metadata)(nil), // 4: backup.v1.Metadata + (*LogChunk)(nil), // 5: backup.v1.LogChunk + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp +} var file_backup_v1_common_proto_depIdxs = []int32{ 2, // 0: backup.v1.Metadata.file_list:type_name -> backup.v1.File 6, // 1: backup.v1.Metadata.restore_to:type_name -> google.protobuf.Timestamp diff --git a/api/backup/v1/common.swagger.json b/api/backup/v1/common.swagger.json new file mode 100644 index 00000000000..4e41fc07567 --- /dev/null +++ b/api/backup/v1/common.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "backup/v1/common.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/backup/v1/errors.pb.go b/api/backup/v1/errors.pb.go index d67aecce84c..a9645403e6b 100644 --- a/api/backup/v1/errors.pb.go +++ b/api/backup/v1/errors.pb.go @@ -7,12 +7,11 @@ package backupv1 import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -161,15 +160,12 @@ func file_backup_v1_errors_proto_rawDescGZIP() []byte { return file_backup_v1_errors_proto_rawDescData } -var ( - file_backup_v1_errors_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_backup_v1_errors_proto_msgTypes = make([]protoimpl.MessageInfo, 1) - file_backup_v1_errors_proto_goTypes = []any{ - (ErrorCode)(0), // 0: backup.v1.ErrorCode - (*Error)(nil), // 1: backup.v1.Error - } -) - +var file_backup_v1_errors_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_backup_v1_errors_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_backup_v1_errors_proto_goTypes = []any{ + (ErrorCode)(0), // 0: backup.v1.ErrorCode + (*Error)(nil), // 1: backup.v1.Error +} var file_backup_v1_errors_proto_depIdxs = []int32{ 0, // 0: backup.v1.Error.code:type_name -> backup.v1.ErrorCode 1, // [1:1] is the sub-list for method output_type diff --git a/api/backup/v1/errors.swagger.json b/api/backup/v1/errors.swagger.json new file mode 100644 index 00000000000..59e7b363676 --- /dev/null +++ b/api/backup/v1/errors.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "backup/v1/errors.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/backup/v1/locations.pb.go b/api/backup/v1/locations.pb.go index 808bad5ba2a..f0f1c7b8280 100644 --- a/api/backup/v1/locations.pb.go +++ b/api/backup/v1/locations.pb.go @@ -7,15 +7,14 @@ package backupv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -813,25 +812,22 @@ func file_backup_v1_locations_proto_rawDescGZIP() []byte { return file_backup_v1_locations_proto_rawDescData } -var ( - file_backup_v1_locations_proto_msgTypes = make([]protoimpl.MessageInfo, 13) - file_backup_v1_locations_proto_goTypes = []any{ - (*FilesystemLocationConfig)(nil), // 0: backup.v1.FilesystemLocationConfig - (*S3LocationConfig)(nil), // 1: backup.v1.S3LocationConfig - (*Location)(nil), // 2: backup.v1.Location - (*ListLocationsRequest)(nil), // 3: backup.v1.ListLocationsRequest - (*ListLocationsResponse)(nil), // 4: backup.v1.ListLocationsResponse - (*AddLocationRequest)(nil), // 5: backup.v1.AddLocationRequest - (*AddLocationResponse)(nil), // 6: backup.v1.AddLocationResponse - (*ChangeLocationRequest)(nil), // 7: backup.v1.ChangeLocationRequest - (*ChangeLocationResponse)(nil), // 8: backup.v1.ChangeLocationResponse - (*RemoveLocationRequest)(nil), // 9: backup.v1.RemoveLocationRequest - (*RemoveLocationResponse)(nil), // 10: backup.v1.RemoveLocationResponse - (*TestLocationConfigRequest)(nil), // 11: backup.v1.TestLocationConfigRequest - (*TestLocationConfigResponse)(nil), // 12: backup.v1.TestLocationConfigResponse - } -) - +var file_backup_v1_locations_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_backup_v1_locations_proto_goTypes = []any{ + (*FilesystemLocationConfig)(nil), // 0: backup.v1.FilesystemLocationConfig + (*S3LocationConfig)(nil), // 1: backup.v1.S3LocationConfig + (*Location)(nil), // 2: backup.v1.Location + (*ListLocationsRequest)(nil), // 3: backup.v1.ListLocationsRequest + (*ListLocationsResponse)(nil), // 4: backup.v1.ListLocationsResponse + (*AddLocationRequest)(nil), // 5: backup.v1.AddLocationRequest + (*AddLocationResponse)(nil), // 6: backup.v1.AddLocationResponse + (*ChangeLocationRequest)(nil), // 7: backup.v1.ChangeLocationRequest + (*ChangeLocationResponse)(nil), // 8: backup.v1.ChangeLocationResponse + (*RemoveLocationRequest)(nil), // 9: backup.v1.RemoveLocationRequest + (*RemoveLocationResponse)(nil), // 10: backup.v1.RemoveLocationResponse + (*TestLocationConfigRequest)(nil), // 11: backup.v1.TestLocationConfigRequest + (*TestLocationConfigResponse)(nil), // 12: backup.v1.TestLocationConfigResponse +} var file_backup_v1_locations_proto_depIdxs = []int32{ 0, // 0: backup.v1.Location.filesystem_config:type_name -> backup.v1.FilesystemLocationConfig 1, // 1: backup.v1.Location.s3_config:type_name -> backup.v1.S3LocationConfig diff --git a/api/backup/v1/locations.swagger.json b/api/backup/v1/locations.swagger.json new file mode 100644 index 00000000000..26f36fcb836 --- /dev/null +++ b/api/backup/v1/locations.swagger.json @@ -0,0 +1,353 @@ +{ + "swagger": "2.0", + "info": { + "title": "backup/v1/locations.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "LocationsService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/backups/locations": { + "get": { + "summary": "List Backup Locations", + "description": "List backup locations.", + "operationId": "ListLocations", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListLocationsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "LocationsService" + ] + }, + "post": { + "summary": "Add a Backup Location", + "description": "Add a backup location.", + "operationId": "AddLocation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1AddLocationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1AddLocationRequest" + } + } + ], + "tags": [ + "LocationsService" + ] + } + }, + "/v1/backups/locations/{location_id}": { + "delete": { + "summary": "Remove a Scheduled Backup", + "description": "Remove a backup location.", + "operationId": "RemoveLocation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RemoveLocationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "location_id", + "description": "Machine-readable ID.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "force", + "description": "Force mode", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "LocationsService" + ] + }, + "put": { + "summary": "Change a Backup Location", + "description": "Change a backup location.", + "operationId": "ChangeLocation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ChangeLocationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "location_id", + "description": "Machine-readable ID.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/LocationsServiceChangeLocationBody" + } + } + ], + "tags": [ + "LocationsService" + ] + } + }, + "/v1/backups/locations:testConfig": { + "post": { + "summary": "Test a Backup Location and Credentials", + "description": "Test a backup location and credentials.", + "operationId": "TestLocationConfig", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1TestLocationConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1TestLocationConfigRequest" + } + } + ], + "tags": [ + "LocationsService" + ] + } + } + }, + "definitions": { + "LocationsServiceChangeLocationBody": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Location name" + }, + "description": { + "type": "string" + }, + "filesystem_config": { + "$ref": "#/definitions/v1FilesystemLocationConfig", + "description": "Filesystem location configuration. Exactly one config should be set." + }, + "s3_config": { + "$ref": "#/definitions/v1S3LocationConfig", + "description": "S3 Bucket configuration. Exactly one config should be set." + } + } + }, + "backupV1Location": { + "type": "object", + "properties": { + "location_id": { + "type": "string", + "description": "Machine-readable ID." + }, + "name": { + "type": "string", + "title": "Location name" + }, + "description": { + "type": "string", + "title": "Short description" + }, + "filesystem_config": { + "$ref": "#/definitions/v1FilesystemLocationConfig" + }, + "s3_config": { + "$ref": "#/definitions/v1S3LocationConfig" + } + }, + "description": "Location represents single Backup Location." + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1AddLocationRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Location name" + }, + "description": { + "type": "string" + }, + "filesystem_config": { + "$ref": "#/definitions/v1FilesystemLocationConfig", + "description": "Filesystem location configuration. Exactly one config should be set." + }, + "s3_config": { + "$ref": "#/definitions/v1S3LocationConfig", + "description": "S3 Bucket configuration. Exactly one config should be set." + } + } + }, + "v1AddLocationResponse": { + "type": "object", + "properties": { + "location_id": { + "type": "string", + "description": "Machine-readable ID." + } + } + }, + "v1ChangeLocationResponse": { + "type": "object" + }, + "v1FilesystemLocationConfig": { + "type": "object", + "properties": { + "path": { + "type": "string" + } + }, + "description": "FilesystemLocationConfig represents file system location config." + }, + "v1ListLocationsResponse": { + "type": "object", + "properties": { + "locations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/backupV1Location" + } + } + } + }, + "v1RemoveLocationResponse": { + "type": "object" + }, + "v1S3LocationConfig": { + "type": "object", + "properties": { + "endpoint": { + "type": "string" + }, + "access_key": { + "type": "string" + }, + "secret_key": { + "type": "string" + }, + "bucket_name": { + "type": "string" + } + }, + "description": "S3LocationConfig represents S3 bucket configuration." + }, + "v1TestLocationConfigRequest": { + "type": "object", + "properties": { + "filesystem_config": { + "$ref": "#/definitions/v1FilesystemLocationConfig", + "description": "Filesystem location configuration. Exactly one config should be set." + }, + "s3_config": { + "$ref": "#/definitions/v1S3LocationConfig", + "description": "S3 Bucket configuration. Exactly one config should be set." + } + } + }, + "v1TestLocationConfigResponse": { + "type": "object" + } + } +} diff --git a/api/backup/v1/locations_grpc.pb.go b/api/backup/v1/locations_grpc.pb.go index 15b1c781046..628344a5a7c 100644 --- a/api/backup/v1/locations_grpc.pb.go +++ b/api/backup/v1/locations_grpc.pb.go @@ -8,7 +8,6 @@ package backupv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -132,19 +131,15 @@ type UnimplementedLocationsServiceServer struct{} func (UnimplementedLocationsServiceServer) ListLocations(context.Context, *ListLocationsRequest) (*ListLocationsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListLocations not implemented") } - func (UnimplementedLocationsServiceServer) AddLocation(context.Context, *AddLocationRequest) (*AddLocationResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddLocation not implemented") } - func (UnimplementedLocationsServiceServer) ChangeLocation(context.Context, *ChangeLocationRequest) (*ChangeLocationResponse, error) { return nil, status.Error(codes.Unimplemented, "method ChangeLocation not implemented") } - func (UnimplementedLocationsServiceServer) RemoveLocation(context.Context, *RemoveLocationRequest) (*RemoveLocationResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveLocation not implemented") } - func (UnimplementedLocationsServiceServer) TestLocationConfig(context.Context, *TestLocationConfigRequest) (*TestLocationConfigResponse, error) { return nil, status.Error(codes.Unimplemented, "method TestLocationConfig not implemented") } diff --git a/api/backup/v1/restores.pb.go b/api/backup/v1/restores.pb.go index 272b5255d28..04d7b270102 100644 --- a/api/backup/v1/restores.pb.go +++ b/api/backup/v1/restores.pb.go @@ -7,16 +7,15 @@ package backupv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -608,24 +607,21 @@ func file_backup_v1_restores_proto_rawDescGZIP() []byte { return file_backup_v1_restores_proto_rawDescData } -var ( - file_backup_v1_restores_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_backup_v1_restores_proto_msgTypes = make([]protoimpl.MessageInfo, 7) - file_backup_v1_restores_proto_goTypes = []any{ - (RestoreStatus)(0), // 0: backup.v1.RestoreStatus - (*RestoreHistoryItem)(nil), // 1: backup.v1.RestoreHistoryItem - (*ListRestoresRequest)(nil), // 2: backup.v1.ListRestoresRequest - (*ListRestoresResponse)(nil), // 3: backup.v1.ListRestoresResponse - (*RestoreServiceGetLogsRequest)(nil), // 4: backup.v1.RestoreServiceGetLogsRequest - (*RestoreServiceGetLogsResponse)(nil), // 5: backup.v1.RestoreServiceGetLogsResponse - (*RestoreBackupRequest)(nil), // 6: backup.v1.RestoreBackupRequest - (*RestoreBackupResponse)(nil), // 7: backup.v1.RestoreBackupResponse - (DataModel)(0), // 8: backup.v1.DataModel - (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp - (*LogChunk)(nil), // 10: backup.v1.LogChunk - } -) - +var file_backup_v1_restores_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_backup_v1_restores_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_backup_v1_restores_proto_goTypes = []any{ + (RestoreStatus)(0), // 0: backup.v1.RestoreStatus + (*RestoreHistoryItem)(nil), // 1: backup.v1.RestoreHistoryItem + (*ListRestoresRequest)(nil), // 2: backup.v1.ListRestoresRequest + (*ListRestoresResponse)(nil), // 3: backup.v1.ListRestoresResponse + (*RestoreServiceGetLogsRequest)(nil), // 4: backup.v1.RestoreServiceGetLogsRequest + (*RestoreServiceGetLogsResponse)(nil), // 5: backup.v1.RestoreServiceGetLogsResponse + (*RestoreBackupRequest)(nil), // 6: backup.v1.RestoreBackupRequest + (*RestoreBackupResponse)(nil), // 7: backup.v1.RestoreBackupResponse + (DataModel)(0), // 8: backup.v1.DataModel + (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp + (*LogChunk)(nil), // 10: backup.v1.LogChunk +} var file_backup_v1_restores_proto_depIdxs = []int32{ 8, // 0: backup.v1.RestoreHistoryItem.data_model:type_name -> backup.v1.DataModel 0, // 1: backup.v1.RestoreHistoryItem.status:type_name -> backup.v1.RestoreStatus diff --git a/api/backup/v1/restores.swagger.json b/api/backup/v1/restores.swagger.json new file mode 100644 index 00000000000..e7089206289 --- /dev/null +++ b/api/backup/v1/restores.swagger.json @@ -0,0 +1,303 @@ +{ + "swagger": "2.0", + "info": { + "title": "backup/v1/restores.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "RestoreService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/backups/restores": { + "get": { + "summary": "List Restore History", + "description": "List all backup restore history items", + "operationId": "ListRestores", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListRestoresResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "RestoreService" + ] + } + }, + "/v1/backups/restores/{restore_id}/logs": { + "get": { + "summary": "Get Logs", + "description": "Get logs from the underlying tools for a restore job", + "operationId": "GetLogs", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RestoreServiceGetLogsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "restore_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "offset", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "name": "limit", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "RestoreService" + ] + } + }, + "/v1/backups/restores:start": { + "post": { + "summary": "Restore from a Backup", + "description": "Could return the Error message in the details containing specific ErrorCode indicating failure reason:\nERROR_CODE_XTRABACKUP_NOT_INSTALLED - xtrabackup is not installed on the service\nERROR_CODE_INVALID_XTRABACKUP - different versions of xtrabackup and xbcloud\nERROR_CODE_INCOMPATIBLE_XTRABACKUP - xtrabackup is not compatible with MySQL for taking a backup\nERROR_CODE_INCOMPATIBLE_TARGET_MYSQL - target MySQL version is not compatible with the artifact for performing a restore of the backup", + "operationId": "RestoreBackup", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RestoreBackupResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1RestoreBackupRequest" + } + } + ], + "tags": [ + "RestoreService" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1DataModel": { + "type": "string", + "enum": [ + "DATA_MODEL_UNSPECIFIED", + "DATA_MODEL_PHYSICAL", + "DATA_MODEL_LOGICAL" + ], + "default": "DATA_MODEL_UNSPECIFIED", + "description": "DataModel is a model used for performing a backup." + }, + "v1ListRestoresResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RestoreHistoryItem" + } + } + } + }, + "v1LogChunk": { + "type": "object", + "properties": { + "chunk_id": { + "type": "integer", + "format": "int64" + }, + "data": { + "type": "string" + } + }, + "description": "LogChunk represent one chunk of logs." + }, + "v1RestoreBackupRequest": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Service identifier where backup should be restored." + }, + "artifact_id": { + "type": "string", + "description": "Artifact id to restore." + }, + "pitr_timestamp": { + "type": "string", + "format": "date-time", + "title": "Timestamp of PITR to restore to" + } + } + }, + "v1RestoreBackupResponse": { + "type": "object", + "properties": { + "restore_id": { + "type": "string", + "description": "Unique restore identifier." + } + } + }, + "v1RestoreHistoryItem": { + "type": "object", + "properties": { + "restore_id": { + "type": "string", + "description": "Machine-readable restore id." + }, + "artifact_id": { + "type": "string", + "description": "ID of the artifact used for restore." + }, + "name": { + "type": "string", + "description": "Artifact name used for restore." + }, + "vendor": { + "type": "string", + "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL." + }, + "location_id": { + "type": "string", + "description": "Machine-readable location ID." + }, + "location_name": { + "type": "string", + "description": "Location name." + }, + "service_id": { + "type": "string", + "description": "Machine-readable service ID." + }, + "service_name": { + "type": "string", + "description": "Service name." + }, + "data_model": { + "$ref": "#/definitions/v1DataModel", + "description": "Backup data model." + }, + "status": { + "$ref": "#/definitions/v1RestoreStatus", + "description": "Restore status." + }, + "started_at": { + "type": "string", + "format": "date-time", + "description": "Restore start time." + }, + "finished_at": { + "type": "string", + "format": "date-time", + "description": "Restore finish time." + }, + "pitr_timestamp": { + "type": "string", + "format": "date-time", + "description": "PITR timestamp is filled for PITR restores, empty otherwise." + } + }, + "description": "RestoreHistoryItem represents single backup restore item." + }, + "v1RestoreServiceGetLogsResponse": { + "type": "object", + "properties": { + "logs": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1LogChunk" + } + }, + "end": { + "type": "boolean" + } + } + }, + "v1RestoreStatus": { + "type": "string", + "enum": [ + "RESTORE_STATUS_UNSPECIFIED", + "RESTORE_STATUS_IN_PROGRESS", + "RESTORE_STATUS_SUCCESS", + "RESTORE_STATUS_ERROR" + ], + "default": "RESTORE_STATUS_UNSPECIFIED", + "description": "RestoreStatus shows the current status of execution of restore." + } + } +} diff --git a/api/backup/v1/restores_grpc.pb.go b/api/backup/v1/restores_grpc.pb.go index c27c45e9f4e..a7fdce1c5f0 100644 --- a/api/backup/v1/restores_grpc.pb.go +++ b/api/backup/v1/restores_grpc.pb.go @@ -8,7 +8,6 @@ package backupv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -102,11 +101,9 @@ type UnimplementedRestoreServiceServer struct{} func (UnimplementedRestoreServiceServer) ListRestores(context.Context, *ListRestoresRequest) (*ListRestoresResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListRestores not implemented") } - func (UnimplementedRestoreServiceServer) GetLogs(context.Context, *RestoreServiceGetLogsRequest) (*RestoreServiceGetLogsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetLogs not implemented") } - func (UnimplementedRestoreServiceServer) RestoreBackup(context.Context, *RestoreBackupRequest) (*RestoreBackupResponse, error) { return nil, status.Error(codes.Unimplemented, "method RestoreBackup not implemented") } diff --git a/api/common/common.pb.go b/api/common/common.pb.go index 0d05883daa1..5c809939700 100644 --- a/api/common/common.pb.go +++ b/api/common/common.pb.go @@ -7,12 +7,11 @@ package common import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -139,15 +138,12 @@ func file_common_common_proto_rawDescGZIP() []byte { return file_common_common_proto_rawDescData } -var ( - file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 3) - file_common_common_proto_goTypes = []any{ - (*StringArray)(nil), // 0: common.StringArray - (*StringMap)(nil), // 1: common.StringMap - nil, // 2: common.StringMap.ValuesEntry - } -) - +var file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_common_common_proto_goTypes = []any{ + (*StringArray)(nil), // 0: common.StringArray + (*StringMap)(nil), // 1: common.StringMap + nil, // 2: common.StringMap.ValuesEntry +} var file_common_common_proto_depIdxs = []int32{ 2, // 0: common.StringMap.values:type_name -> common.StringMap.ValuesEntry 1, // [1:1] is the sub-list for method output_type diff --git a/api/common/common.swagger.json b/api/common/common.swagger.json new file mode 100644 index 00000000000..613dea17f41 --- /dev/null +++ b/api/common/common.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "common/common.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/common/metrics_resolutions.pb.go b/api/common/metrics_resolutions.pb.go index 75e587ba9a5..30e99f3894f 100644 --- a/api/common/metrics_resolutions.pb.go +++ b/api/common/metrics_resolutions.pb.go @@ -7,13 +7,12 @@ package common import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -111,14 +110,11 @@ func file_common_metrics_resolutions_proto_rawDescGZIP() []byte { return file_common_metrics_resolutions_proto_rawDescData } -var ( - file_common_metrics_resolutions_proto_msgTypes = make([]protoimpl.MessageInfo, 1) - file_common_metrics_resolutions_proto_goTypes = []any{ - (*MetricsResolutions)(nil), // 0: common.MetricsResolutions - (*durationpb.Duration)(nil), // 1: google.protobuf.Duration - } -) - +var file_common_metrics_resolutions_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_common_metrics_resolutions_proto_goTypes = []any{ + (*MetricsResolutions)(nil), // 0: common.MetricsResolutions + (*durationpb.Duration)(nil), // 1: google.protobuf.Duration +} var file_common_metrics_resolutions_proto_depIdxs = []int32{ 1, // 0: common.MetricsResolutions.hr:type_name -> google.protobuf.Duration 1, // 1: common.MetricsResolutions.mr:type_name -> google.protobuf.Duration diff --git a/api/common/metrics_resolutions.swagger.json b/api/common/metrics_resolutions.swagger.json new file mode 100644 index 00000000000..995cc971e4a --- /dev/null +++ b/api/common/metrics_resolutions.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "common/metrics_resolutions.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/dump/v1beta1/dump.pb.go b/api/dump/v1beta1/dump.pb.go index 3cd88013859..e9e73ce9e7d 100644 --- a/api/dump/v1beta1/dump.pb.go +++ b/api/dump/v1beta1/dump.pb.go @@ -7,16 +7,15 @@ package dumpv1beta1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -844,28 +843,25 @@ func file_dump_v1beta1_dump_proto_rawDescGZIP() []byte { return file_dump_v1beta1_dump_proto_rawDescData } -var ( - file_dump_v1beta1_dump_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_dump_v1beta1_dump_proto_msgTypes = make([]protoimpl.MessageInfo, 13) - file_dump_v1beta1_dump_proto_goTypes = []any{ - (DumpStatus)(0), // 0: dump.v1beta1.DumpStatus - (*Dump)(nil), // 1: dump.v1beta1.Dump - (*StartDumpRequest)(nil), // 2: dump.v1beta1.StartDumpRequest - (*StartDumpResponse)(nil), // 3: dump.v1beta1.StartDumpResponse - (*ListDumpsRequest)(nil), // 4: dump.v1beta1.ListDumpsRequest - (*ListDumpsResponse)(nil), // 5: dump.v1beta1.ListDumpsResponse - (*DeleteDumpRequest)(nil), // 6: dump.v1beta1.DeleteDumpRequest - (*DeleteDumpResponse)(nil), // 7: dump.v1beta1.DeleteDumpResponse - (*GetDumpLogsRequest)(nil), // 8: dump.v1beta1.GetDumpLogsRequest - (*GetDumpLogsResponse)(nil), // 9: dump.v1beta1.GetDumpLogsResponse - (*LogChunk)(nil), // 10: dump.v1beta1.LogChunk - (*SFTPParameters)(nil), // 11: dump.v1beta1.SFTPParameters - (*UploadDumpRequest)(nil), // 12: dump.v1beta1.UploadDumpRequest - (*UploadDumpResponse)(nil), // 13: dump.v1beta1.UploadDumpResponse - (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp - } -) - +var file_dump_v1beta1_dump_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_dump_v1beta1_dump_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_dump_v1beta1_dump_proto_goTypes = []any{ + (DumpStatus)(0), // 0: dump.v1beta1.DumpStatus + (*Dump)(nil), // 1: dump.v1beta1.Dump + (*StartDumpRequest)(nil), // 2: dump.v1beta1.StartDumpRequest + (*StartDumpResponse)(nil), // 3: dump.v1beta1.StartDumpResponse + (*ListDumpsRequest)(nil), // 4: dump.v1beta1.ListDumpsRequest + (*ListDumpsResponse)(nil), // 5: dump.v1beta1.ListDumpsResponse + (*DeleteDumpRequest)(nil), // 6: dump.v1beta1.DeleteDumpRequest + (*DeleteDumpResponse)(nil), // 7: dump.v1beta1.DeleteDumpResponse + (*GetDumpLogsRequest)(nil), // 8: dump.v1beta1.GetDumpLogsRequest + (*GetDumpLogsResponse)(nil), // 9: dump.v1beta1.GetDumpLogsResponse + (*LogChunk)(nil), // 10: dump.v1beta1.LogChunk + (*SFTPParameters)(nil), // 11: dump.v1beta1.SFTPParameters + (*UploadDumpRequest)(nil), // 12: dump.v1beta1.UploadDumpRequest + (*UploadDumpResponse)(nil), // 13: dump.v1beta1.UploadDumpResponse + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp +} var file_dump_v1beta1_dump_proto_depIdxs = []int32{ 0, // 0: dump.v1beta1.Dump.status:type_name -> dump.v1beta1.DumpStatus 14, // 1: dump.v1beta1.Dump.start_time:type_name -> google.protobuf.Timestamp diff --git a/api/dump/v1beta1/dump.swagger.json b/api/dump/v1beta1/dump.swagger.json new file mode 100644 index 00000000000..a8f75c5d21d --- /dev/null +++ b/api/dump/v1beta1/dump.swagger.json @@ -0,0 +1,383 @@ +{ + "swagger": "2.0", + "info": { + "title": "dump/v1beta1/dump.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "DumpService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/dumps": { + "get": { + "summary": "List All Dumps", + "description": "List all dumps", + "operationId": "ListDumps", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1ListDumpsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "DumpService" + ] + } + }, + "/v1/dumps/{dump_id}/logs": { + "get": { + "summary": "Get Dump Logs", + "description": "Get logs of a selected dump.", + "operationId": "GetDumpLogs", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1GetDumpLogsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "dump_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "offset", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "name": "limit", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "DumpService" + ] + } + }, + "/v1/dumps:batchDelete": { + "post": { + "summary": "Delete Dumps", + "description": "Delete selected dumps.", + "operationId": "DeleteDump", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1DeleteDumpResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1beta1DeleteDumpRequest" + } + } + ], + "tags": [ + "DumpService" + ] + } + }, + "/v1/dumps:start": { + "post": { + "summary": "Start a New Dump", + "description": "Start a new dump.", + "operationId": "StartDump", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1StartDumpResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1beta1StartDumpRequest" + } + } + ], + "tags": [ + "DumpService" + ] + } + }, + "/v1/dumps:upload": { + "post": { + "summary": "Upload Dumps", + "description": "Upload selected dumps to a remote server.", + "operationId": "UploadDump", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1UploadDumpResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1beta1UploadDumpRequest" + } + } + ], + "tags": [ + "DumpService" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1beta1DeleteDumpRequest": { + "type": "object", + "properties": { + "dump_ids": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "v1beta1DeleteDumpResponse": { + "type": "object" + }, + "v1beta1Dump": { + "type": "object", + "properties": { + "dump_id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/v1beta1DumpStatus" + }, + "service_names": { + "type": "array", + "items": { + "type": "string" + } + }, + "start_time": { + "type": "string", + "format": "date-time" + }, + "end_time": { + "type": "string", + "format": "date-time" + }, + "created_at": { + "type": "string", + "format": "date-time" + } + } + }, + "v1beta1DumpStatus": { + "type": "string", + "enum": [ + "DUMP_STATUS_UNSPECIFIED", + "DUMP_STATUS_IN_PROGRESS", + "DUMP_STATUS_SUCCESS", + "DUMP_STATUS_ERROR" + ], + "default": "DUMP_STATUS_UNSPECIFIED" + }, + "v1beta1GetDumpLogsResponse": { + "type": "object", + "properties": { + "logs": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1beta1LogChunk" + } + }, + "end": { + "type": "boolean" + } + } + }, + "v1beta1ListDumpsResponse": { + "type": "object", + "properties": { + "dumps": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1beta1Dump" + } + } + } + }, + "v1beta1LogChunk": { + "type": "object", + "properties": { + "chunk_id": { + "type": "integer", + "format": "int64" + }, + "data": { + "type": "string" + } + }, + "description": "LogChunk represent one chunk of logs." + }, + "v1beta1SFTPParameters": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "user": { + "type": "string" + }, + "password": { + "type": "string" + }, + "directory": { + "type": "string" + } + } + }, + "v1beta1StartDumpRequest": { + "type": "object", + "properties": { + "service_names": { + "type": "array", + "items": { + "type": "string" + } + }, + "start_time": { + "type": "string", + "format": "date-time" + }, + "end_time": { + "type": "string", + "format": "date-time" + }, + "export_qan": { + "type": "boolean" + }, + "ignore_load": { + "type": "boolean" + } + } + }, + "v1beta1StartDumpResponse": { + "type": "object", + "properties": { + "dump_id": { + "type": "string" + } + } + }, + "v1beta1UploadDumpRequest": { + "type": "object", + "properties": { + "dump_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "sftp_parameters": { + "$ref": "#/definitions/v1beta1SFTPParameters", + "description": "SFTP upload parameters." + } + } + }, + "v1beta1UploadDumpResponse": { + "type": "object" + } + } +} diff --git a/api/dump/v1beta1/dump_grpc.pb.go b/api/dump/v1beta1/dump_grpc.pb.go index 987f75bd579..bb65b07cc1b 100644 --- a/api/dump/v1beta1/dump_grpc.pb.go +++ b/api/dump/v1beta1/dump_grpc.pb.go @@ -8,7 +8,6 @@ package dumpv1beta1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -128,19 +127,15 @@ type UnimplementedDumpServiceServer struct{} func (UnimplementedDumpServiceServer) StartDump(context.Context, *StartDumpRequest) (*StartDumpResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartDump not implemented") } - func (UnimplementedDumpServiceServer) ListDumps(context.Context, *ListDumpsRequest) (*ListDumpsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListDumps not implemented") } - func (UnimplementedDumpServiceServer) DeleteDump(context.Context, *DeleteDumpRequest) (*DeleteDumpResponse, error) { return nil, status.Error(codes.Unimplemented, "method DeleteDump not implemented") } - func (UnimplementedDumpServiceServer) GetDumpLogs(context.Context, *GetDumpLogsRequest) (*GetDumpLogsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetDumpLogs not implemented") } - func (UnimplementedDumpServiceServer) UploadDump(context.Context, *UploadDumpRequest) (*UploadDumpResponse, error) { return nil, status.Error(codes.Unimplemented, "method UploadDump not implemented") } diff --git a/api/ha/v1beta1/ha.pb.go b/api/ha/v1beta1/ha.pb.go index 5b2c2efaf36..c592f717052 100644 --- a/api/ha/v1beta1/ha.pb.go +++ b/api/ha/v1beta1/ha.pb.go @@ -7,14 +7,13 @@ package hav1beta1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -339,19 +338,16 @@ func file_ha_v1beta1_ha_proto_rawDescGZIP() []byte { return file_ha_v1beta1_ha_proto_rawDescData } -var ( - file_ha_v1beta1_ha_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_ha_v1beta1_ha_proto_msgTypes = make([]protoimpl.MessageInfo, 5) - file_ha_v1beta1_ha_proto_goTypes = []any{ - (NodeRole)(0), // 0: ha.v1beta1.NodeRole - (*ListNodesRequest)(nil), // 1: ha.v1beta1.ListNodesRequest - (*HANode)(nil), // 2: ha.v1beta1.HANode - (*ListNodesResponse)(nil), // 3: ha.v1beta1.ListNodesResponse - (*StatusRequest)(nil), // 4: ha.v1beta1.StatusRequest - (*StatusResponse)(nil), // 5: ha.v1beta1.StatusResponse - } -) - +var file_ha_v1beta1_ha_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_ha_v1beta1_ha_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_ha_v1beta1_ha_proto_goTypes = []any{ + (NodeRole)(0), // 0: ha.v1beta1.NodeRole + (*ListNodesRequest)(nil), // 1: ha.v1beta1.ListNodesRequest + (*HANode)(nil), // 2: ha.v1beta1.HANode + (*ListNodesResponse)(nil), // 3: ha.v1beta1.ListNodesResponse + (*StatusRequest)(nil), // 4: ha.v1beta1.StatusRequest + (*StatusResponse)(nil), // 5: ha.v1beta1.StatusResponse +} var file_ha_v1beta1_ha_proto_depIdxs = []int32{ 0, // 0: ha.v1beta1.HANode.role:type_name -> ha.v1beta1.NodeRole 2, // 1: ha.v1beta1.ListNodesResponse.nodes:type_name -> ha.v1beta1.HANode diff --git a/api/ha/v1beta1/ha.swagger.json b/api/ha/v1beta1/ha.swagger.json new file mode 100644 index 00000000000..eab5d5f5d2f --- /dev/null +++ b/api/ha/v1beta1/ha.swagger.json @@ -0,0 +1,148 @@ +{ + "swagger": "2.0", + "info": { + "title": "ha/v1beta1/ha.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "HAService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/ha/nodes": { + "get": { + "summary": "List HA Nodes", + "description": "Returns a list of all nodes in the High Availability cluster with their current status and roles.", + "operationId": "ListNodes", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1ListNodesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "tags": [ + "HAService" + ] + } + }, + "/v1/ha/status": { + "get": { + "summary": "HA Status", + "description": "Returns whether High Availability mode is enabled or disabled.", + "operationId": "Status", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1StatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "tags": [ + "HAService" + ] + } + } + }, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "v1beta1HANode": { + "type": "object", + "properties": { + "node_name": { + "type": "string", + "description": "Human-readable name of the node." + }, + "role": { + "$ref": "#/definitions/v1beta1NodeRole", + "description": "Role of the node in the cluster." + }, + "status": { + "type": "string", + "description": "Current status of the node from MemberList." + } + }, + "description": "HANode represents a single node in the HA cluster." + }, + "v1beta1ListNodesResponse": { + "type": "object", + "properties": { + "nodes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1beta1HANode" + }, + "description": "List of nodes in the HA cluster." + } + } + }, + "v1beta1NodeRole": { + "type": "string", + "enum": [ + "NODE_ROLE_UNSPECIFIED", + "NODE_ROLE_LEADER", + "NODE_ROLE_FOLLOWER" + ], + "default": "NODE_ROLE_UNSPECIFIED", + "description": "NodeRole represents the role of a node in the HA cluster." + }, + "v1beta1StatusResponse": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of HA mode: \"Enabled\" or \"Disabled\"." + } + } + } + } +} diff --git a/api/ha/v1beta1/ha_grpc.pb.go b/api/ha/v1beta1/ha_grpc.pb.go index 75e664a29e5..c723d8996be 100644 --- a/api/ha/v1beta1/ha_grpc.pb.go +++ b/api/ha/v1beta1/ha_grpc.pb.go @@ -8,7 +8,6 @@ package hav1beta1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -87,7 +86,6 @@ type UnimplementedHAServiceServer struct{} func (UnimplementedHAServiceServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { return nil, status.Error(codes.Unimplemented, "method Status not implemented") } - func (UnimplementedHAServiceServer) ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListNodes not implemented") } diff --git a/api/inventory/v1/agent_status.pb.go b/api/inventory/v1/agent_status.pb.go index 01af45754b1..025bb50c788 100644 --- a/api/inventory/v1/agent_status.pb.go +++ b/api/inventory/v1/agent_status.pb.go @@ -7,12 +7,11 @@ package inventoryv1 import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -122,13 +121,10 @@ func file_inventory_v1_agent_status_proto_rawDescGZIP() []byte { return file_inventory_v1_agent_status_proto_rawDescData } -var ( - file_inventory_v1_agent_status_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_inventory_v1_agent_status_proto_goTypes = []any{ - (AgentStatus)(0), // 0: inventory.v1.AgentStatus - } -) - +var file_inventory_v1_agent_status_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_inventory_v1_agent_status_proto_goTypes = []any{ + (AgentStatus)(0), // 0: inventory.v1.AgentStatus +} var file_inventory_v1_agent_status_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/inventory/v1/agent_status.swagger.json b/api/inventory/v1/agent_status.swagger.json new file mode 100644 index 00000000000..2e9902fb83f --- /dev/null +++ b/api/inventory/v1/agent_status.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "inventory/v1/agent_status.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/inventory/v1/agents.pb.go b/api/inventory/v1/agents.pb.go index e619a04e91a..6b53a101528 100644 --- a/api/inventory/v1/agents.pb.go +++ b/api/inventory/v1/agents.pb.go @@ -7,18 +7,16 @@ package inventoryv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + common "github.com/percona/pmm/api/common" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" - - common "github.com/percona/pmm/api/common" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -12243,126 +12241,123 @@ func file_inventory_v1_agents_proto_rawDescGZIP() []byte { return file_inventory_v1_agents_proto_rawDescData } -var ( - file_inventory_v1_agents_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_inventory_v1_agents_proto_msgTypes = make([]protoimpl.MessageInfo, 107) - file_inventory_v1_agents_proto_goTypes = []any{ - (AgentType)(0), // 0: inventory.v1.AgentType - (*PMMAgent)(nil), // 1: inventory.v1.PMMAgent - (*VMAgent)(nil), // 2: inventory.v1.VMAgent - (*NomadAgent)(nil), // 3: inventory.v1.NomadAgent - (*NodeExporter)(nil), // 4: inventory.v1.NodeExporter - (*MySQLdExporter)(nil), // 5: inventory.v1.MySQLdExporter - (*MongoDBExporter)(nil), // 6: inventory.v1.MongoDBExporter - (*PostgresExporter)(nil), // 7: inventory.v1.PostgresExporter - (*ProxySQLExporter)(nil), // 8: inventory.v1.ProxySQLExporter - (*ValkeyExporter)(nil), // 9: inventory.v1.ValkeyExporter - (*QANMySQLPerfSchemaAgent)(nil), // 10: inventory.v1.QANMySQLPerfSchemaAgent - (*QANMySQLSlowlogAgent)(nil), // 11: inventory.v1.QANMySQLSlowlogAgent - (*QANMongoDBProfilerAgent)(nil), // 12: inventory.v1.QANMongoDBProfilerAgent - (*QANMongoDBMongologAgent)(nil), // 13: inventory.v1.QANMongoDBMongologAgent - (*RTAOptions)(nil), // 14: inventory.v1.RTAOptions - (*RTAMongoDBAgent)(nil), // 15: inventory.v1.RTAMongoDBAgent - (*QANPostgreSQLPgStatementsAgent)(nil), // 16: inventory.v1.QANPostgreSQLPgStatementsAgent - (*QANPostgreSQLPgStatMonitorAgent)(nil), // 17: inventory.v1.QANPostgreSQLPgStatMonitorAgent - (*RDSExporter)(nil), // 18: inventory.v1.RDSExporter - (*ExternalExporter)(nil), // 19: inventory.v1.ExternalExporter - (*AzureDatabaseExporter)(nil), // 20: inventory.v1.AzureDatabaseExporter - (*ChangeCommonAgentParams)(nil), // 21: inventory.v1.ChangeCommonAgentParams - (*ListAgentsRequest)(nil), // 22: inventory.v1.ListAgentsRequest - (*ListAgentsResponse)(nil), // 23: inventory.v1.ListAgentsResponse - (*GetAgentRequest)(nil), // 24: inventory.v1.GetAgentRequest - (*GetAgentResponse)(nil), // 25: inventory.v1.GetAgentResponse - (*GetAgentLogsRequest)(nil), // 26: inventory.v1.GetAgentLogsRequest - (*GetAgentLogsResponse)(nil), // 27: inventory.v1.GetAgentLogsResponse - (*AddAgentRequest)(nil), // 28: inventory.v1.AddAgentRequest - (*AddAgentResponse)(nil), // 29: inventory.v1.AddAgentResponse - (*ChangeAgentRequest)(nil), // 30: inventory.v1.ChangeAgentRequest - (*ChangeAgentResponse)(nil), // 31: inventory.v1.ChangeAgentResponse - (*AddPMMAgentParams)(nil), // 32: inventory.v1.AddPMMAgentParams - (*AddNodeExporterParams)(nil), // 33: inventory.v1.AddNodeExporterParams - (*ChangeNodeExporterParams)(nil), // 34: inventory.v1.ChangeNodeExporterParams - (*AddMySQLdExporterParams)(nil), // 35: inventory.v1.AddMySQLdExporterParams - (*ChangeMySQLdExporterParams)(nil), // 36: inventory.v1.ChangeMySQLdExporterParams - (*AddMongoDBExporterParams)(nil), // 37: inventory.v1.AddMongoDBExporterParams - (*ChangeMongoDBExporterParams)(nil), // 38: inventory.v1.ChangeMongoDBExporterParams - (*AddPostgresExporterParams)(nil), // 39: inventory.v1.AddPostgresExporterParams - (*ChangePostgresExporterParams)(nil), // 40: inventory.v1.ChangePostgresExporterParams - (*AddProxySQLExporterParams)(nil), // 41: inventory.v1.AddProxySQLExporterParams - (*ChangeProxySQLExporterParams)(nil), // 42: inventory.v1.ChangeProxySQLExporterParams - (*AddQANMySQLPerfSchemaAgentParams)(nil), // 43: inventory.v1.AddQANMySQLPerfSchemaAgentParams - (*ChangeQANMySQLPerfSchemaAgentParams)(nil), // 44: inventory.v1.ChangeQANMySQLPerfSchemaAgentParams - (*AddQANMySQLSlowlogAgentParams)(nil), // 45: inventory.v1.AddQANMySQLSlowlogAgentParams - (*ChangeQANMySQLSlowlogAgentParams)(nil), // 46: inventory.v1.ChangeQANMySQLSlowlogAgentParams - (*AddQANMongoDBProfilerAgentParams)(nil), // 47: inventory.v1.AddQANMongoDBProfilerAgentParams - (*ChangeQANMongoDBProfilerAgentParams)(nil), // 48: inventory.v1.ChangeQANMongoDBProfilerAgentParams - (*AddQANMongoDBMongologAgentParams)(nil), // 49: inventory.v1.AddQANMongoDBMongologAgentParams - (*ChangeQANMongoDBMongologAgentParams)(nil), // 50: inventory.v1.ChangeQANMongoDBMongologAgentParams - (*AddQANPostgreSQLPgStatementsAgentParams)(nil), // 51: inventory.v1.AddQANPostgreSQLPgStatementsAgentParams - (*ChangeQANPostgreSQLPgStatementsAgentParams)(nil), // 52: inventory.v1.ChangeQANPostgreSQLPgStatementsAgentParams - (*AddQANPostgreSQLPgStatMonitorAgentParams)(nil), // 53: inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams - (*ChangeQANPostgreSQLPgStatMonitorAgentParams)(nil), // 54: inventory.v1.ChangeQANPostgreSQLPgStatMonitorAgentParams - (*AddRDSExporterParams)(nil), // 55: inventory.v1.AddRDSExporterParams - (*ChangeRDSExporterParams)(nil), // 56: inventory.v1.ChangeRDSExporterParams - (*AddExternalExporterParams)(nil), // 57: inventory.v1.AddExternalExporterParams - (*ChangeExternalExporterParams)(nil), // 58: inventory.v1.ChangeExternalExporterParams - (*AddAzureDatabaseExporterParams)(nil), // 59: inventory.v1.AddAzureDatabaseExporterParams - (*ChangeAzureDatabaseExporterParams)(nil), // 60: inventory.v1.ChangeAzureDatabaseExporterParams - (*ChangeNomadAgentParams)(nil), // 61: inventory.v1.ChangeNomadAgentParams - (*AddValkeyExporterParams)(nil), // 62: inventory.v1.AddValkeyExporterParams - (*ChangeValkeyExporterParams)(nil), // 63: inventory.v1.ChangeValkeyExporterParams - (*AddRTAMongoDBAgentParams)(nil), // 64: inventory.v1.AddRTAMongoDBAgentParams - (*ChangeRTAMongoDBAgentParams)(nil), // 65: inventory.v1.ChangeRTAMongoDBAgentParams - (*RemoveAgentRequest)(nil), // 66: inventory.v1.RemoveAgentRequest - (*RemoveAgentResponse)(nil), // 67: inventory.v1.RemoveAgentResponse - nil, // 68: inventory.v1.PMMAgent.CustomLabelsEntry - nil, // 69: inventory.v1.NodeExporter.CustomLabelsEntry - nil, // 70: inventory.v1.MySQLdExporter.CustomLabelsEntry - nil, // 71: inventory.v1.MySQLdExporter.ExtraDsnParamsEntry - nil, // 72: inventory.v1.MongoDBExporter.CustomLabelsEntry - nil, // 73: inventory.v1.PostgresExporter.CustomLabelsEntry - nil, // 74: inventory.v1.ProxySQLExporter.CustomLabelsEntry - nil, // 75: inventory.v1.ValkeyExporter.CustomLabelsEntry - nil, // 76: inventory.v1.QANMySQLPerfSchemaAgent.CustomLabelsEntry - nil, // 77: inventory.v1.QANMySQLPerfSchemaAgent.ExtraDsnParamsEntry - nil, // 78: inventory.v1.QANMySQLSlowlogAgent.CustomLabelsEntry - nil, // 79: inventory.v1.QANMySQLSlowlogAgent.ExtraDsnParamsEntry - nil, // 80: inventory.v1.QANMongoDBProfilerAgent.CustomLabelsEntry - nil, // 81: inventory.v1.QANMongoDBMongologAgent.CustomLabelsEntry - nil, // 82: inventory.v1.RTAMongoDBAgent.CustomLabelsEntry - nil, // 83: inventory.v1.QANPostgreSQLPgStatementsAgent.CustomLabelsEntry - nil, // 84: inventory.v1.QANPostgreSQLPgStatMonitorAgent.CustomLabelsEntry - nil, // 85: inventory.v1.RDSExporter.CustomLabelsEntry - nil, // 86: inventory.v1.ExternalExporter.CustomLabelsEntry - nil, // 87: inventory.v1.AzureDatabaseExporter.CustomLabelsEntry - nil, // 88: inventory.v1.AddPMMAgentParams.CustomLabelsEntry - nil, // 89: inventory.v1.AddNodeExporterParams.CustomLabelsEntry - nil, // 90: inventory.v1.AddMySQLdExporterParams.CustomLabelsEntry - nil, // 91: inventory.v1.AddMySQLdExporterParams.ExtraDsnParamsEntry - nil, // 92: inventory.v1.AddMongoDBExporterParams.CustomLabelsEntry - nil, // 93: inventory.v1.AddPostgresExporterParams.CustomLabelsEntry - nil, // 94: inventory.v1.AddProxySQLExporterParams.CustomLabelsEntry - nil, // 95: inventory.v1.AddQANMySQLPerfSchemaAgentParams.CustomLabelsEntry - nil, // 96: inventory.v1.AddQANMySQLPerfSchemaAgentParams.ExtraDsnParamsEntry - nil, // 97: inventory.v1.AddQANMySQLSlowlogAgentParams.CustomLabelsEntry - nil, // 98: inventory.v1.AddQANMySQLSlowlogAgentParams.ExtraDsnParamsEntry - nil, // 99: inventory.v1.AddQANMongoDBProfilerAgentParams.CustomLabelsEntry - nil, // 100: inventory.v1.AddQANMongoDBMongologAgentParams.CustomLabelsEntry - nil, // 101: inventory.v1.AddQANPostgreSQLPgStatementsAgentParams.CustomLabelsEntry - nil, // 102: inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams.CustomLabelsEntry - nil, // 103: inventory.v1.AddRDSExporterParams.CustomLabelsEntry - nil, // 104: inventory.v1.AddExternalExporterParams.CustomLabelsEntry - nil, // 105: inventory.v1.AddAzureDatabaseExporterParams.CustomLabelsEntry - nil, // 106: inventory.v1.AddValkeyExporterParams.CustomLabelsEntry - nil, // 107: inventory.v1.AddRTAMongoDBAgentParams.CustomLabelsEntry - (AgentStatus)(0), // 108: inventory.v1.AgentStatus - (LogLevel)(0), // 109: inventory.v1.LogLevel - (*common.MetricsResolutions)(nil), // 110: common.MetricsResolutions - (*durationpb.Duration)(nil), // 111: google.protobuf.Duration - (*common.StringMap)(nil), // 112: common.StringMap - } -) - +var file_inventory_v1_agents_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_inventory_v1_agents_proto_msgTypes = make([]protoimpl.MessageInfo, 107) +var file_inventory_v1_agents_proto_goTypes = []any{ + (AgentType)(0), // 0: inventory.v1.AgentType + (*PMMAgent)(nil), // 1: inventory.v1.PMMAgent + (*VMAgent)(nil), // 2: inventory.v1.VMAgent + (*NomadAgent)(nil), // 3: inventory.v1.NomadAgent + (*NodeExporter)(nil), // 4: inventory.v1.NodeExporter + (*MySQLdExporter)(nil), // 5: inventory.v1.MySQLdExporter + (*MongoDBExporter)(nil), // 6: inventory.v1.MongoDBExporter + (*PostgresExporter)(nil), // 7: inventory.v1.PostgresExporter + (*ProxySQLExporter)(nil), // 8: inventory.v1.ProxySQLExporter + (*ValkeyExporter)(nil), // 9: inventory.v1.ValkeyExporter + (*QANMySQLPerfSchemaAgent)(nil), // 10: inventory.v1.QANMySQLPerfSchemaAgent + (*QANMySQLSlowlogAgent)(nil), // 11: inventory.v1.QANMySQLSlowlogAgent + (*QANMongoDBProfilerAgent)(nil), // 12: inventory.v1.QANMongoDBProfilerAgent + (*QANMongoDBMongologAgent)(nil), // 13: inventory.v1.QANMongoDBMongologAgent + (*RTAOptions)(nil), // 14: inventory.v1.RTAOptions + (*RTAMongoDBAgent)(nil), // 15: inventory.v1.RTAMongoDBAgent + (*QANPostgreSQLPgStatementsAgent)(nil), // 16: inventory.v1.QANPostgreSQLPgStatementsAgent + (*QANPostgreSQLPgStatMonitorAgent)(nil), // 17: inventory.v1.QANPostgreSQLPgStatMonitorAgent + (*RDSExporter)(nil), // 18: inventory.v1.RDSExporter + (*ExternalExporter)(nil), // 19: inventory.v1.ExternalExporter + (*AzureDatabaseExporter)(nil), // 20: inventory.v1.AzureDatabaseExporter + (*ChangeCommonAgentParams)(nil), // 21: inventory.v1.ChangeCommonAgentParams + (*ListAgentsRequest)(nil), // 22: inventory.v1.ListAgentsRequest + (*ListAgentsResponse)(nil), // 23: inventory.v1.ListAgentsResponse + (*GetAgentRequest)(nil), // 24: inventory.v1.GetAgentRequest + (*GetAgentResponse)(nil), // 25: inventory.v1.GetAgentResponse + (*GetAgentLogsRequest)(nil), // 26: inventory.v1.GetAgentLogsRequest + (*GetAgentLogsResponse)(nil), // 27: inventory.v1.GetAgentLogsResponse + (*AddAgentRequest)(nil), // 28: inventory.v1.AddAgentRequest + (*AddAgentResponse)(nil), // 29: inventory.v1.AddAgentResponse + (*ChangeAgentRequest)(nil), // 30: inventory.v1.ChangeAgentRequest + (*ChangeAgentResponse)(nil), // 31: inventory.v1.ChangeAgentResponse + (*AddPMMAgentParams)(nil), // 32: inventory.v1.AddPMMAgentParams + (*AddNodeExporterParams)(nil), // 33: inventory.v1.AddNodeExporterParams + (*ChangeNodeExporterParams)(nil), // 34: inventory.v1.ChangeNodeExporterParams + (*AddMySQLdExporterParams)(nil), // 35: inventory.v1.AddMySQLdExporterParams + (*ChangeMySQLdExporterParams)(nil), // 36: inventory.v1.ChangeMySQLdExporterParams + (*AddMongoDBExporterParams)(nil), // 37: inventory.v1.AddMongoDBExporterParams + (*ChangeMongoDBExporterParams)(nil), // 38: inventory.v1.ChangeMongoDBExporterParams + (*AddPostgresExporterParams)(nil), // 39: inventory.v1.AddPostgresExporterParams + (*ChangePostgresExporterParams)(nil), // 40: inventory.v1.ChangePostgresExporterParams + (*AddProxySQLExporterParams)(nil), // 41: inventory.v1.AddProxySQLExporterParams + (*ChangeProxySQLExporterParams)(nil), // 42: inventory.v1.ChangeProxySQLExporterParams + (*AddQANMySQLPerfSchemaAgentParams)(nil), // 43: inventory.v1.AddQANMySQLPerfSchemaAgentParams + (*ChangeQANMySQLPerfSchemaAgentParams)(nil), // 44: inventory.v1.ChangeQANMySQLPerfSchemaAgentParams + (*AddQANMySQLSlowlogAgentParams)(nil), // 45: inventory.v1.AddQANMySQLSlowlogAgentParams + (*ChangeQANMySQLSlowlogAgentParams)(nil), // 46: inventory.v1.ChangeQANMySQLSlowlogAgentParams + (*AddQANMongoDBProfilerAgentParams)(nil), // 47: inventory.v1.AddQANMongoDBProfilerAgentParams + (*ChangeQANMongoDBProfilerAgentParams)(nil), // 48: inventory.v1.ChangeQANMongoDBProfilerAgentParams + (*AddQANMongoDBMongologAgentParams)(nil), // 49: inventory.v1.AddQANMongoDBMongologAgentParams + (*ChangeQANMongoDBMongologAgentParams)(nil), // 50: inventory.v1.ChangeQANMongoDBMongologAgentParams + (*AddQANPostgreSQLPgStatementsAgentParams)(nil), // 51: inventory.v1.AddQANPostgreSQLPgStatementsAgentParams + (*ChangeQANPostgreSQLPgStatementsAgentParams)(nil), // 52: inventory.v1.ChangeQANPostgreSQLPgStatementsAgentParams + (*AddQANPostgreSQLPgStatMonitorAgentParams)(nil), // 53: inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams + (*ChangeQANPostgreSQLPgStatMonitorAgentParams)(nil), // 54: inventory.v1.ChangeQANPostgreSQLPgStatMonitorAgentParams + (*AddRDSExporterParams)(nil), // 55: inventory.v1.AddRDSExporterParams + (*ChangeRDSExporterParams)(nil), // 56: inventory.v1.ChangeRDSExporterParams + (*AddExternalExporterParams)(nil), // 57: inventory.v1.AddExternalExporterParams + (*ChangeExternalExporterParams)(nil), // 58: inventory.v1.ChangeExternalExporterParams + (*AddAzureDatabaseExporterParams)(nil), // 59: inventory.v1.AddAzureDatabaseExporterParams + (*ChangeAzureDatabaseExporterParams)(nil), // 60: inventory.v1.ChangeAzureDatabaseExporterParams + (*ChangeNomadAgentParams)(nil), // 61: inventory.v1.ChangeNomadAgentParams + (*AddValkeyExporterParams)(nil), // 62: inventory.v1.AddValkeyExporterParams + (*ChangeValkeyExporterParams)(nil), // 63: inventory.v1.ChangeValkeyExporterParams + (*AddRTAMongoDBAgentParams)(nil), // 64: inventory.v1.AddRTAMongoDBAgentParams + (*ChangeRTAMongoDBAgentParams)(nil), // 65: inventory.v1.ChangeRTAMongoDBAgentParams + (*RemoveAgentRequest)(nil), // 66: inventory.v1.RemoveAgentRequest + (*RemoveAgentResponse)(nil), // 67: inventory.v1.RemoveAgentResponse + nil, // 68: inventory.v1.PMMAgent.CustomLabelsEntry + nil, // 69: inventory.v1.NodeExporter.CustomLabelsEntry + nil, // 70: inventory.v1.MySQLdExporter.CustomLabelsEntry + nil, // 71: inventory.v1.MySQLdExporter.ExtraDsnParamsEntry + nil, // 72: inventory.v1.MongoDBExporter.CustomLabelsEntry + nil, // 73: inventory.v1.PostgresExporter.CustomLabelsEntry + nil, // 74: inventory.v1.ProxySQLExporter.CustomLabelsEntry + nil, // 75: inventory.v1.ValkeyExporter.CustomLabelsEntry + nil, // 76: inventory.v1.QANMySQLPerfSchemaAgent.CustomLabelsEntry + nil, // 77: inventory.v1.QANMySQLPerfSchemaAgent.ExtraDsnParamsEntry + nil, // 78: inventory.v1.QANMySQLSlowlogAgent.CustomLabelsEntry + nil, // 79: inventory.v1.QANMySQLSlowlogAgent.ExtraDsnParamsEntry + nil, // 80: inventory.v1.QANMongoDBProfilerAgent.CustomLabelsEntry + nil, // 81: inventory.v1.QANMongoDBMongologAgent.CustomLabelsEntry + nil, // 82: inventory.v1.RTAMongoDBAgent.CustomLabelsEntry + nil, // 83: inventory.v1.QANPostgreSQLPgStatementsAgent.CustomLabelsEntry + nil, // 84: inventory.v1.QANPostgreSQLPgStatMonitorAgent.CustomLabelsEntry + nil, // 85: inventory.v1.RDSExporter.CustomLabelsEntry + nil, // 86: inventory.v1.ExternalExporter.CustomLabelsEntry + nil, // 87: inventory.v1.AzureDatabaseExporter.CustomLabelsEntry + nil, // 88: inventory.v1.AddPMMAgentParams.CustomLabelsEntry + nil, // 89: inventory.v1.AddNodeExporterParams.CustomLabelsEntry + nil, // 90: inventory.v1.AddMySQLdExporterParams.CustomLabelsEntry + nil, // 91: inventory.v1.AddMySQLdExporterParams.ExtraDsnParamsEntry + nil, // 92: inventory.v1.AddMongoDBExporterParams.CustomLabelsEntry + nil, // 93: inventory.v1.AddPostgresExporterParams.CustomLabelsEntry + nil, // 94: inventory.v1.AddProxySQLExporterParams.CustomLabelsEntry + nil, // 95: inventory.v1.AddQANMySQLPerfSchemaAgentParams.CustomLabelsEntry + nil, // 96: inventory.v1.AddQANMySQLPerfSchemaAgentParams.ExtraDsnParamsEntry + nil, // 97: inventory.v1.AddQANMySQLSlowlogAgentParams.CustomLabelsEntry + nil, // 98: inventory.v1.AddQANMySQLSlowlogAgentParams.ExtraDsnParamsEntry + nil, // 99: inventory.v1.AddQANMongoDBProfilerAgentParams.CustomLabelsEntry + nil, // 100: inventory.v1.AddQANMongoDBMongologAgentParams.CustomLabelsEntry + nil, // 101: inventory.v1.AddQANPostgreSQLPgStatementsAgentParams.CustomLabelsEntry + nil, // 102: inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams.CustomLabelsEntry + nil, // 103: inventory.v1.AddRDSExporterParams.CustomLabelsEntry + nil, // 104: inventory.v1.AddExternalExporterParams.CustomLabelsEntry + nil, // 105: inventory.v1.AddAzureDatabaseExporterParams.CustomLabelsEntry + nil, // 106: inventory.v1.AddValkeyExporterParams.CustomLabelsEntry + nil, // 107: inventory.v1.AddRTAMongoDBAgentParams.CustomLabelsEntry + (AgentStatus)(0), // 108: inventory.v1.AgentStatus + (LogLevel)(0), // 109: inventory.v1.LogLevel + (*common.MetricsResolutions)(nil), // 110: common.MetricsResolutions + (*durationpb.Duration)(nil), // 111: google.protobuf.Duration + (*common.StringMap)(nil), // 112: common.StringMap +} var file_inventory_v1_agents_proto_depIdxs = []int32{ 68, // 0: inventory.v1.PMMAgent.custom_labels:type_name -> inventory.v1.PMMAgent.CustomLabelsEntry 108, // 1: inventory.v1.VMAgent.status:type_name -> inventory.v1.AgentStatus diff --git a/api/inventory/v1/agents.pb.validate.go b/api/inventory/v1/agents.pb.validate.go index 7e45f186227..0f2d68e9a5f 100644 --- a/api/inventory/v1/agents.pb.validate.go +++ b/api/inventory/v1/agents.pb.validate.go @@ -2909,6 +2909,7 @@ func (m *ChangeCommonAgentParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -2937,6 +2938,7 @@ func (m *ChangeCommonAgentParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -8610,6 +8612,7 @@ func (m *ChangeNodeExporterParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -8638,6 +8641,7 @@ func (m *ChangeNodeExporterParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -8951,6 +8955,7 @@ func (m *ChangeMySQLdExporterParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -8979,6 +8984,7 @@ func (m *ChangeMySQLdExporterParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -9327,6 +9333,7 @@ func (m *ChangeMongoDBExporterParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -9355,6 +9362,7 @@ func (m *ChangeMongoDBExporterParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -9721,6 +9729,7 @@ func (m *ChangePostgresExporterParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -9749,6 +9758,7 @@ func (m *ChangePostgresExporterParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -10097,6 +10107,7 @@ func (m *ChangeProxySQLExporterParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -10125,6 +10136,7 @@ func (m *ChangeProxySQLExporterParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -10461,6 +10473,7 @@ func (m *ChangeQANMySQLPerfSchemaAgentParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -10489,6 +10502,7 @@ func (m *ChangeQANMySQLPerfSchemaAgentParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -10846,6 +10860,7 @@ func (m *ChangeQANMySQLSlowlogAgentParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -10874,6 +10889,7 @@ func (m *ChangeQANMySQLSlowlogAgentParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -11224,6 +11240,7 @@ func (m *ChangeQANMongoDBProfilerAgentParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -11252,6 +11269,7 @@ func (m *ChangeQANMongoDBProfilerAgentParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -11594,6 +11612,7 @@ func (m *ChangeQANMongoDBMongologAgentParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -11622,6 +11641,7 @@ func (m *ChangeQANMongoDBMongologAgentParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -11973,6 +11993,7 @@ func (m *ChangeQANPostgreSQLPgStatementsAgentParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -12001,6 +12022,7 @@ func (m *ChangeQANPostgreSQLPgStatementsAgentParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -12350,6 +12372,7 @@ func (m *ChangeQANPostgreSQLPgStatMonitorAgentParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -12378,6 +12401,7 @@ func (m *ChangeQANPostgreSQLPgStatMonitorAgentParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -12706,6 +12730,7 @@ func (m *ChangeRDSExporterParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -12734,6 +12759,7 @@ func (m *ChangeRDSExporterParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -13036,6 +13062,7 @@ func (m *ChangeExternalExporterParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -13064,6 +13091,7 @@ func (m *ChangeExternalExporterParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -13378,6 +13406,7 @@ func (m *ChangeAzureDatabaseExporterParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -13406,6 +13435,7 @@ func (m *ChangeAzureDatabaseExporterParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -13848,6 +13878,7 @@ func (m *ChangeValkeyExporterParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -13876,6 +13907,7 @@ func (m *ChangeValkeyExporterParams) validate(all bool) error { } } } + } if m.EnablePushMetrics != nil { @@ -13883,6 +13915,7 @@ func (m *ChangeValkeyExporterParams) validate(all bool) error { } if m.Username != nil { + if utf8.RuneCountInString(m.GetUsername()) < 1 { err := ChangeValkeyExporterParamsValidationError{ field: "Username", @@ -13893,6 +13926,7 @@ func (m *ChangeValkeyExporterParams) validate(all bool) error { } errors = append(errors, err) } + } if m.Password != nil { @@ -14213,6 +14247,7 @@ func (m *ChangeRTAMongoDBAgentParams) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -14241,6 +14276,7 @@ func (m *ChangeRTAMongoDBAgentParams) validate(all bool) error { } } } + } if m.LogLevel != nil { @@ -14280,6 +14316,7 @@ func (m *ChangeRTAMongoDBAgentParams) validate(all bool) error { } if m.RtaOptions != nil { + if all { switch v := interface{}(m.GetRtaOptions()).(type) { case interface{ ValidateAll() error }: @@ -14308,6 +14345,7 @@ func (m *ChangeRTAMongoDBAgentParams) validate(all bool) error { } } } + } if len(errors) > 0 { diff --git a/api/inventory/v1/agents.swagger.json b/api/inventory/v1/agents.swagger.json new file mode 100644 index 00000000000..61bb3972d8d --- /dev/null +++ b/api/inventory/v1/agents.swagger.json @@ -0,0 +1,4430 @@ +{ + "swagger": "2.0", + "info": { + "title": "inventory/v1/agents.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "AgentsService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/inventory/agents": { + "get": { + "summary": "List Agents", + "description": "Returns a list of all Agents.", + "operationId": "ListAgents", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListAgentsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "pmm_agent_id", + "description": "Return only Agents started by this pmm-agent.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "node_id", + "description": "Return only Agents that provide insights for that Node.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "service_id", + "description": "Return only Agents that provide insights for that Service.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "agent_type", + "description": "Return only agents of a particular type.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "AGENT_TYPE_UNSPECIFIED", + "AGENT_TYPE_PMM_AGENT", + "AGENT_TYPE_VM_AGENT", + "AGENT_TYPE_NODE_EXPORTER", + "AGENT_TYPE_MYSQLD_EXPORTER", + "AGENT_TYPE_MONGODB_EXPORTER", + "AGENT_TYPE_POSTGRES_EXPORTER", + "AGENT_TYPE_PROXYSQL_EXPORTER", + "AGENT_TYPE_VALKEY_EXPORTER", + "AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT", + "AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT", + "AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT", + "AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT", + "AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT", + "AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT", + "AGENT_TYPE_EXTERNAL_EXPORTER", + "AGENT_TYPE_RDS_EXPORTER", + "AGENT_TYPE_AZURE_DATABASE_EXPORTER", + "AGENT_TYPE_NOMAD_AGENT", + "AGENT_TYPE_RTA_MONGODB_AGENT" + ], + "default": "AGENT_TYPE_UNSPECIFIED" + } + ], + "tags": [ + "AgentsService" + ] + }, + "post": { + "summary": "Add an Agent to Inventory", + "description": "Adds an Agent to Inventory. Only one agent at a time can be passed.", + "operationId": "AddAgent", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1AddAgentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1AddAgentRequest" + } + } + ], + "tags": [ + "AgentsService" + ] + } + }, + "/v1/inventory/agents/{agent_id}": { + "get": { + "summary": "Get Agent", + "description": "Returns a single Agent by ID.", + "operationId": "GetAgent", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetAgentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "agent_id", + "description": "Unique randomly generated instance identifier.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "AgentsService" + ] + }, + "delete": { + "summary": "Remove an Agent from Inventory", + "description": "Removes an Agent from Inventory.", + "operationId": "RemoveAgent", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RemoveAgentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "force", + "description": "Remove agent with all dependencies.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "AgentsService" + ] + }, + "put": { + "summary": "Update an Agent in Inventory", + "description": "Updates an Agent in Inventory. Only one agent at a time can be passed.", + "operationId": "ChangeAgent", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ChangeAgentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AgentsServiceChangeAgentBody" + } + } + ], + "tags": [ + "AgentsService" + ] + } + }, + "/v1/inventory/agents/{agent_id}/logs": { + "get": { + "summary": "Get Agent logs", + "description": "Returns Agent logs by ID.", + "operationId": "GetAgentLogs", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetAgentLogsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "agent_id", + "description": "Unique randomly generated instance identifier.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "limit", + "description": "Limit the number of log lines to this value. Pass 0 for no limit.", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "AgentsService" + ] + } + } + }, + "definitions": { + "AgentsServiceChangeAgentBody": { + "type": "object", + "properties": { + "node_exporter": { + "$ref": "#/definitions/v1ChangeNodeExporterParams" + }, + "mysqld_exporter": { + "$ref": "#/definitions/v1ChangeMySQLdExporterParams" + }, + "mongodb_exporter": { + "$ref": "#/definitions/v1ChangeMongoDBExporterParams" + }, + "postgres_exporter": { + "$ref": "#/definitions/v1ChangePostgresExporterParams" + }, + "proxysql_exporter": { + "$ref": "#/definitions/v1ChangeProxySQLExporterParams" + }, + "external_exporter": { + "$ref": "#/definitions/v1ChangeExternalExporterParams" + }, + "rds_exporter": { + "$ref": "#/definitions/v1ChangeRDSExporterParams" + }, + "azure_database_exporter": { + "$ref": "#/definitions/v1ChangeAzureDatabaseExporterParams" + }, + "qan_mysql_perfschema_agent": { + "$ref": "#/definitions/v1ChangeQANMySQLPerfSchemaAgentParams" + }, + "qan_mysql_slowlog_agent": { + "$ref": "#/definitions/v1ChangeQANMySQLSlowlogAgentParams" + }, + "qan_mongodb_profiler_agent": { + "$ref": "#/definitions/v1ChangeQANMongoDBProfilerAgentParams" + }, + "qan_mongodb_mongolog_agent": { + "$ref": "#/definitions/v1ChangeQANMongoDBMongologAgentParams" + }, + "qan_postgresql_pgstatements_agent": { + "$ref": "#/definitions/v1ChangeQANPostgreSQLPgStatementsAgentParams" + }, + "qan_postgresql_pgstatmonitor_agent": { + "$ref": "#/definitions/v1ChangeQANPostgreSQLPgStatMonitorAgentParams" + }, + "nomad_agent": { + "$ref": "#/definitions/v1ChangeNomadAgentParams" + }, + "valkey_exporter": { + "$ref": "#/definitions/v1ChangeValkeyExporterParams" + }, + "rta_mongodb_agent": { + "$ref": "#/definitions/v1ChangeRTAMongoDBAgentParams" + } + } + }, + "commonMetricsResolutions": { + "type": "object", + "properties": { + "hr": { + "type": "string", + "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix." + }, + "mr": { + "type": "string", + "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix." + }, + "lr": { + "type": "string", + "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix." + } + }, + "description": "MetricsResolutions represents Prometheus exporters metrics resolutions." + }, + "commonStringMap": { + "type": "object", + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value." + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1AddAgentRequest": { + "type": "object", + "properties": { + "pmm_agent": { + "$ref": "#/definitions/v1AddPMMAgentParams" + }, + "node_exporter": { + "$ref": "#/definitions/v1AddNodeExporterParams" + }, + "mysqld_exporter": { + "$ref": "#/definitions/v1AddMySQLdExporterParams" + }, + "mongodb_exporter": { + "$ref": "#/definitions/v1AddMongoDBExporterParams" + }, + "postgres_exporter": { + "$ref": "#/definitions/v1AddPostgresExporterParams" + }, + "proxysql_exporter": { + "$ref": "#/definitions/v1AddProxySQLExporterParams" + }, + "external_exporter": { + "$ref": "#/definitions/v1AddExternalExporterParams" + }, + "rds_exporter": { + "$ref": "#/definitions/v1AddRDSExporterParams" + }, + "azure_database_exporter": { + "$ref": "#/definitions/v1AddAzureDatabaseExporterParams" + }, + "qan_mysql_perfschema_agent": { + "$ref": "#/definitions/v1AddQANMySQLPerfSchemaAgentParams" + }, + "qan_mysql_slowlog_agent": { + "$ref": "#/definitions/v1AddQANMySQLSlowlogAgentParams" + }, + "qan_mongodb_profiler_agent": { + "$ref": "#/definitions/v1AddQANMongoDBProfilerAgentParams" + }, + "qan_mongodb_mongolog_agent": { + "$ref": "#/definitions/v1AddQANMongoDBMongologAgentParams" + }, + "qan_postgresql_pgstatements_agent": { + "$ref": "#/definitions/v1AddQANPostgreSQLPgStatementsAgentParams" + }, + "qan_postgresql_pgstatmonitor_agent": { + "$ref": "#/definitions/v1AddQANPostgreSQLPgStatMonitorAgentParams" + }, + "valkey_exporter": { + "$ref": "#/definitions/v1AddValkeyExporterParams" + }, + "rta_mongodb_agent": { + "$ref": "#/definitions/v1AddRTAMongoDBAgentParams" + } + } + }, + "v1AddAgentResponse": { + "type": "object", + "properties": { + "pmm_agent": { + "$ref": "#/definitions/v1PMMAgent" + }, + "node_exporter": { + "$ref": "#/definitions/v1NodeExporter" + }, + "mysqld_exporter": { + "$ref": "#/definitions/v1MySQLdExporter" + }, + "mongodb_exporter": { + "$ref": "#/definitions/v1MongoDBExporter" + }, + "postgres_exporter": { + "$ref": "#/definitions/v1PostgresExporter" + }, + "proxysql_exporter": { + "$ref": "#/definitions/v1ProxySQLExporter" + }, + "external_exporter": { + "$ref": "#/definitions/v1ExternalExporter" + }, + "rds_exporter": { + "$ref": "#/definitions/v1RDSExporter" + }, + "azure_database_exporter": { + "$ref": "#/definitions/v1AzureDatabaseExporter" + }, + "qan_mysql_perfschema_agent": { + "$ref": "#/definitions/v1QANMySQLPerfSchemaAgent" + }, + "qan_mysql_slowlog_agent": { + "$ref": "#/definitions/v1QANMySQLSlowlogAgent" + }, + "qan_mongodb_profiler_agent": { + "$ref": "#/definitions/v1QANMongoDBProfilerAgent" + }, + "qan_mongodb_mongolog_agent": { + "$ref": "#/definitions/v1QANMongoDBMongologAgent" + }, + "qan_postgresql_pgstatements_agent": { + "$ref": "#/definitions/v1QANPostgreSQLPgStatementsAgent" + }, + "qan_postgresql_pgstatmonitor_agent": { + "$ref": "#/definitions/v1QANPostgreSQLPgStatMonitorAgent" + }, + "valkey_exporter": { + "$ref": "#/definitions/v1ValkeyExporter" + }, + "rta_mongodb_agent": { + "$ref": "#/definitions/v1RTAMongoDBAgent" + } + } + }, + "v1AddAzureDatabaseExporterParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "node_id": { + "type": "string", + "description": "Node identifier." + }, + "azure_client_id": { + "type": "string", + "title": "Azure client ID" + }, + "azure_client_secret": { + "type": "string", + "title": "Azure client secret" + }, + "azure_tenant_id": { + "type": "string", + "title": "Azure tanant ID" + }, + "azure_subscription_id": { + "type": "string", + "title": "Azure subscription ID" + }, + "azure_resource_group": { + "type": "string", + "description": "Azure resource group." + }, + "azure_database_resource_type": { + "type": "string", + "title": "Azure resource type (mysql, maria, postgres)" + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "push_metrics": { + "type": "boolean", + "description": "Enables push metrics mode for exporter." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + } + }, + "v1AddExternalExporterParams": { + "type": "object", + "properties": { + "runs_on_node_id": { + "type": "string", + "description": "The node identifier where this instance is run." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "HTTP basic auth username for collecting metrics." + }, + "password": { + "type": "string", + "description": "HTTP basic auth password for collecting metrics." + }, + "scheme": { + "type": "string", + "description": "Scheme to generate URI to exporter metrics endpoints(default: http)." + }, + "metrics_path": { + "type": "string", + "description": "Path under which metrics are exposed, used to generate URI(default: /metrics)." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "push_metrics": { + "type": "boolean", + "description": "Enables push metrics mode for exporter." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname verification." + } + } + }, + "v1AddMongoDBExporterParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MongoDB username for scraping metrics." + }, + "password": { + "type": "string", + "description": "MongoDB password for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_certificate_key": { + "type": "string", + "description": "Client certificate and key." + }, + "tls_certificate_key_file_password": { + "type": "string", + "description": "Password for decrypting tls_certificate_key." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "push_metrics": { + "type": "boolean", + "description": "Enables push metrics mode for exporter." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "authentication_mechanism": { + "type": "string", + "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details." + }, + "authentication_database": { + "type": "string", + "description": "Authentication database." + }, + "agent_password": { + "type": "string", + "description": "Custom password for exporter endpoint /metrics." + }, + "stats_collections": { + "type": "array", + "items": { + "type": "string" + }, + "title": "List of colletions to get stats from. Can use *" + }, + "collections_limit": { + "type": "integer", + "format": "int32", + "title": "Collections limit. Only get Databases and collection stats if the total number of collections in the server\nis less than this value. 0: no limit" + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "environment_variable_names": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Environment variable names to pass to the exporter.\nValues will be resolved from pmm-agent's environment when starting the exporter." + }, + "enable_all_collectors": { + "type": "boolean", + "description": "Enable all collectors." + } + } + }, + "v1AddMySQLdExporterParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MySQL username for scraping metrics." + }, + "password": { + "type": "string", + "description": "MySQL password for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "tls_cert": { + "type": "string", + "description": "Client certificate." + }, + "tls_key": { + "type": "string", + "description": "Password for decrypting tls_cert." + }, + "tablestats_group_table_limit": { + "type": "integer", + "format": "int32", + "description": "Tablestats group collectors will be disabled if there are more than that number of tables.\n0 means tablestats group collectors are always enabled (no limit).\nNegative value means tablestats group collectors are always disabled." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "push_metrics": { + "type": "boolean", + "description": "Enables push metrics mode for exporter." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "agent_password": { + "type": "string", + "description": "Custom password for exporter endpoint /metrics." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra DSN parameters for MySQL connection." + } + } + }, + "v1AddNodeExporterParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "push_metrics": { + "type": "boolean", + "description": "Enables push metrics mode for exporter." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "title": "Expose the node_exporter process on all public interfaces" + } + } + }, + "v1AddPMMAgentParams": { + "type": "object", + "properties": { + "runs_on_node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + } + }, + "v1AddPostgresExporterParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "PostgreSQL username for scraping metrics." + }, + "password": { + "type": "string", + "description": "PostgreSQL password for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "push_metrics": { + "type": "boolean", + "description": "Enables push metrics mode for exporter." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "tls_ca": { + "type": "string", + "description": "TLS CA certificate." + }, + "tls_cert": { + "type": "string", + "description": "TLS Certifcate." + }, + "tls_key": { + "type": "string", + "description": "TLS Certificate Key." + }, + "agent_password": { + "type": "string", + "description": "Custom password for exporter endpoint /metrics." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "auto_discovery_limit": { + "type": "integer", + "format": "int32", + "description": "Limit of databases for auto-discovery." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "max_exporter_connections": { + "type": "integer", + "format": "int32", + "description": "Maximum number of connections that exporter can open to the database instance." + } + } + }, + "v1AddProxySQLExporterParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "ProxySQL username for scraping metrics." + }, + "password": { + "type": "string", + "description": "ProxySQL password for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "push_metrics": { + "type": "boolean", + "description": "Enables push metrics mode for exporter." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "agent_password": { + "type": "string", + "description": "Custom password for exporter endpoint /metrics." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + } + } + }, + "v1AddQANMongoDBMongologAgentParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MongoDB username for getting profile data." + }, + "password": { + "type": "string", + "description": "MongoDB password for getting profile data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_certificate_key": { + "type": "string", + "description": "Client certificate and key." + }, + "tls_certificate_key_file_password": { + "type": "string", + "description": "Password for decrypting tls_certificate_key." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "authentication_mechanism": { + "type": "string", + "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details." + }, + "authentication_database": { + "type": "string", + "description": "Authentication database." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for agent." + } + } + }, + "v1AddQANMongoDBProfilerAgentParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MongoDB username for getting profile data." + }, + "password": { + "type": "string", + "description": "MongoDB password for getting profile data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_certificate_key": { + "type": "string", + "description": "Client certificate and key." + }, + "tls_certificate_key_file_password": { + "type": "string", + "description": "Password for decrypting tls_certificate_key." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "authentication_mechanism": { + "type": "string", + "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details." + }, + "authentication_database": { + "type": "string", + "description": "Authentication database." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for agent." + } + } + }, + "v1AddQANMySQLPerfSchemaAgentParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MySQL username for getting performance data." + }, + "password": { + "type": "string", + "description": "MySQL password for getting performance data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "tls_cert": { + "type": "string", + "description": "Client certificate." + }, + "tls_key": { + "type": "string", + "description": "Password for decrypting tls_cert." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "disable_query_examples": { + "type": "boolean", + "description": "Disable query examples." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra DSN parameters for MySQL connection." + } + } + }, + "v1AddQANMySQLSlowlogAgentParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MySQL username for getting slowlog data." + }, + "password": { + "type": "string", + "description": "MySQL password for getting slowlog data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "tls_cert": { + "type": "string", + "description": "Client certificate." + }, + "tls_key": { + "type": "string", + "description": "Password for decrypting tls_cert." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "disable_query_examples": { + "type": "boolean", + "description": "Disable query examples." + }, + "max_slowlog_file_size": { + "type": "string", + "format": "int64", + "description": "Rotate slowlog file at this size if \u003e 0.\nUse zero or negative value to disable rotation." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra DSN parameters for MySQL connection." + } + } + }, + "v1AddQANPostgreSQLPgStatMonitorAgentParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "PostgreSQL username for getting pg stat monitor data." + }, + "password": { + "type": "string", + "description": "PostgreSQL password for getting pg stat monitor data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "disable_query_examples": { + "type": "boolean", + "description": "Disable query examples." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "tls_ca": { + "type": "string", + "description": "TLS CA certificate." + }, + "tls_cert": { + "type": "string", + "description": "TLS Certifcate." + }, + "tls_key": { + "type": "string", + "description": "TLS Certificate Key." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + } + }, + "v1AddQANPostgreSQLPgStatementsAgentParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "PostgreSQL username for getting pg stat statements data." + }, + "password": { + "type": "string", + "description": "PostgreSQL password for getting pg stat statements data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "tls_ca": { + "type": "string", + "description": "TLS CA certificate." + }, + "tls_cert": { + "type": "string", + "description": "TLS Certifcate." + }, + "tls_key": { + "type": "string", + "description": "TLS Certificate Key." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + } + }, + "v1AddRDSExporterParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "node_id": { + "type": "string", + "description": "Node identifier." + }, + "aws_access_key": { + "type": "string", + "description": "AWS Access Key." + }, + "aws_secret_key": { + "type": "string", + "description": "AWS Secret Key." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "disable_basic_metrics": { + "type": "boolean", + "description": "Disable basic metrics." + }, + "disable_enhanced_metrics": { + "type": "boolean", + "description": "Disable enhanced metrics." + }, + "push_metrics": { + "type": "boolean", + "description": "Enables push metrics mode for exporter." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + } + }, + "v1AddRTAMongoDBAgentParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MongoDB username for getting queries data." + }, + "password": { + "type": "string", + "description": "MongoDB password for getting queries data." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for agent." + }, + "tls": { + "type": "boolean", + "description": "MongoDB specific options.\nUse TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_certificate_key": { + "type": "string", + "description": "Client certificate and key." + }, + "tls_certificate_key_file_password": { + "type": "string", + "description": "Password for decrypting tls_certificate_key." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "authentication_mechanism": { + "type": "string", + "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details." + }, + "rta_options": { + "$ref": "#/definitions/v1RTAOptions", + "description": "Real-Time Analytics options." + } + } + }, + "v1AddValkeyExporterParams": { + "type": "object", + "properties": { + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "Valkey username for scraping metrics." + }, + "password": { + "type": "string", + "description": "Valkey password for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "push_metrics": { + "type": "boolean", + "description": "Enables push metrics mode for exporter." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "tls_ca": { + "type": "string", + "description": "TLS CA certificate." + }, + "tls_cert": { + "type": "string", + "description": "TLS Certifcate." + }, + "tls_key": { + "type": "string", + "description": "TLS Certificate Key." + }, + "agent_password": { + "type": "string", + "description": "Custom password for exporter endpoint /metrics." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + } + }, + "v1AgentStatus": { + "type": "string", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ], + "default": "AGENT_STATUS_UNSPECIFIED", + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state." + }, + "v1AgentType": { + "type": "string", + "enum": [ + "AGENT_TYPE_UNSPECIFIED", + "AGENT_TYPE_PMM_AGENT", + "AGENT_TYPE_VM_AGENT", + "AGENT_TYPE_NODE_EXPORTER", + "AGENT_TYPE_MYSQLD_EXPORTER", + "AGENT_TYPE_MONGODB_EXPORTER", + "AGENT_TYPE_POSTGRES_EXPORTER", + "AGENT_TYPE_PROXYSQL_EXPORTER", + "AGENT_TYPE_VALKEY_EXPORTER", + "AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT", + "AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT", + "AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT", + "AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT", + "AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT", + "AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT", + "AGENT_TYPE_EXTERNAL_EXPORTER", + "AGENT_TYPE_RDS_EXPORTER", + "AGENT_TYPE_AZURE_DATABASE_EXPORTER", + "AGENT_TYPE_NOMAD_AGENT", + "AGENT_TYPE_RTA_MONGODB_AGENT" + ], + "default": "AGENT_TYPE_UNSPECIFIED", + "description": "AgentType describes supported Agent types." + }, + "v1AzureDatabaseExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "node_id": { + "type": "string", + "description": "Node identifier." + }, + "azure_database_subscription_id": { + "type": "string", + "description": "Azure database subscription ID." + }, + "azure_database_resource_type": { + "type": "string", + "title": "Azure database resource type (mysql, maria, postgres)" + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status (the same for several configurations)." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics (the same for several configurations)." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if the exporter operates in push metrics mode." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + } + }, + "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure Node metrics." + }, + "v1ChangeAgentResponse": { + "type": "object", + "properties": { + "node_exporter": { + "$ref": "#/definitions/v1NodeExporter" + }, + "mysqld_exporter": { + "$ref": "#/definitions/v1MySQLdExporter" + }, + "mongodb_exporter": { + "$ref": "#/definitions/v1MongoDBExporter" + }, + "postgres_exporter": { + "$ref": "#/definitions/v1PostgresExporter" + }, + "proxysql_exporter": { + "$ref": "#/definitions/v1ProxySQLExporter" + }, + "external_exporter": { + "$ref": "#/definitions/v1ExternalExporter" + }, + "rds_exporter": { + "$ref": "#/definitions/v1RDSExporter" + }, + "azure_database_exporter": { + "$ref": "#/definitions/v1AzureDatabaseExporter" + }, + "qan_mysql_perfschema_agent": { + "$ref": "#/definitions/v1QANMySQLPerfSchemaAgent" + }, + "qan_mysql_slowlog_agent": { + "$ref": "#/definitions/v1QANMySQLSlowlogAgent" + }, + "qan_mongodb_profiler_agent": { + "$ref": "#/definitions/v1QANMongoDBProfilerAgent" + }, + "qan_mongodb_mongolog_agent": { + "$ref": "#/definitions/v1QANMongoDBMongologAgent" + }, + "qan_postgresql_pgstatements_agent": { + "$ref": "#/definitions/v1QANPostgreSQLPgStatementsAgent" + }, + "qan_postgresql_pgstatmonitor_agent": { + "$ref": "#/definitions/v1QANPostgreSQLPgStatMonitorAgent" + }, + "nomad_agent": { + "$ref": "#/definitions/v1NomadAgent" + }, + "valkey_exporter": { + "$ref": "#/definitions/v1ValkeyExporter" + }, + "rta_mongodb_agent": { + "$ref": "#/definitions/v1RTAMongoDBAgent" + } + } + }, + "v1ChangeAzureDatabaseExporterParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "azure_client_id": { + "type": "string", + "x-nullable": true, + "title": "Azure client ID" + }, + "azure_client_secret": { + "type": "string", + "x-nullable": true, + "title": "Azure client secret" + }, + "azure_tenant_id": { + "type": "string", + "x-nullable": true, + "title": "Azure tenant ID" + }, + "azure_subscription_id": { + "type": "string", + "x-nullable": true, + "title": "Azure subscription ID" + }, + "azure_resource_group": { + "type": "string", + "x-nullable": true, + "description": "Azure resource group." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + } + } + }, + "v1ChangeExternalExporterParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "username": { + "type": "string", + "x-nullable": true, + "description": "HTTP basic auth username for collecting metrics." + }, + "scheme": { + "type": "string", + "x-nullable": true, + "description": "Scheme to generate URI to exporter metrics endpoints." + }, + "metrics_path": { + "type": "string", + "x-nullable": true, + "description": "Path under which metrics are exposed, used to generate URI." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "description": "Listen port for scraping metrics." + } + } + }, + "v1ChangeMongoDBExporterParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "username": { + "type": "string", + "x-nullable": true, + "description": "MongoDB username for scraping metrics." + }, + "password": { + "type": "string", + "x-nullable": true, + "description": "MongoDB password for scraping metrics." + }, + "tls": { + "type": "boolean", + "x-nullable": true, + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "x-nullable": true, + "description": "Skip TLS certificate and hostname validation." + }, + "tls_certificate_key": { + "type": "string", + "x-nullable": true, + "description": "Client certificate and key." + }, + "tls_certificate_key_file_password": { + "type": "string", + "x-nullable": true, + "description": "Password for decrypting tls_certificate_key." + }, + "tls_ca": { + "type": "string", + "x-nullable": true, + "description": "Certificate Authority certificate chain." + }, + "skip_connection_check": { + "type": "boolean", + "x-nullable": true, + "description": "Skip connection check." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "authentication_mechanism": { + "type": "string", + "x-nullable": true, + "description": "Authentication mechanism." + }, + "authentication_database": { + "type": "string", + "x-nullable": true, + "description": "Authentication database." + }, + "agent_password": { + "type": "string", + "x-nullable": true, + "description": "Custom password for exporter endpoint /metrics." + }, + "stats_collections": { + "type": "array", + "items": { + "type": "string" + }, + "title": "List of collections to get stats from. Can use *" + }, + "collections_limit": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "title": "Collections limit. Only get Databases and collection stats if the total number of collections in the server is less than this value. 0: no limit" + }, + "enable_all_collectors": { + "type": "boolean", + "x-nullable": true, + "description": "Enable all collectors." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "x-nullable": true, + "description": "Optionally expose the exporter process on all public interfaces." + } + } + }, + "v1ChangeMySQLdExporterParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "username": { + "type": "string", + "x-nullable": true, + "description": "MySQL username for scraping metrics." + }, + "password": { + "type": "string", + "x-nullable": true, + "description": "MySQL password for scraping metrics." + }, + "tls": { + "type": "boolean", + "x-nullable": true, + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "x-nullable": true, + "description": "Skip TLS certificate and hostname validation." + }, + "tls_ca": { + "type": "string", + "x-nullable": true, + "description": "Certificate Authority certificate chain." + }, + "tls_cert": { + "type": "string", + "x-nullable": true, + "description": "Client certificate." + }, + "tls_key": { + "type": "string", + "x-nullable": true, + "description": "Password for decrypting tls_cert." + }, + "tablestats_group_table_limit": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Tablestats group collectors will be disabled if there are more than that number of tables." + }, + "skip_connection_check": { + "type": "boolean", + "x-nullable": true, + "description": "Skip connection check." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "agent_password": { + "type": "string", + "x-nullable": true, + "description": "Custom password for exporter endpoint /metrics." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "x-nullable": true, + "description": "Optionally expose the exporter process on all public interfaces." + } + } + }, + "v1ChangeNodeExporterParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "x-nullable": true, + "description": "Expose the node_exporter process on all public interfaces." + } + } + }, + "v1ChangeNomadAgentParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + } + } + }, + "v1ChangePostgresExporterParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "username": { + "type": "string", + "x-nullable": true, + "description": "PostgreSQL username for scraping metrics." + }, + "password": { + "type": "string", + "x-nullable": true, + "description": "PostgreSQL password for scraping metrics." + }, + "tls": { + "type": "boolean", + "x-nullable": true, + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "x-nullable": true, + "description": "Skip TLS certificate and hostname validation." + }, + "skip_connection_check": { + "type": "boolean", + "x-nullable": true, + "description": "Skip connection check." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "tls_ca": { + "type": "string", + "x-nullable": true, + "description": "TLS CA certificate." + }, + "tls_cert": { + "type": "string", + "x-nullable": true, + "description": "TLS Certificate." + }, + "tls_key": { + "type": "string", + "x-nullable": true, + "description": "TLS Certificate Key." + }, + "agent_password": { + "type": "string", + "x-nullable": true, + "description": "Custom password for exporter endpoint /metrics." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + }, + "auto_discovery_limit": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Limit of databases for auto-discovery." + }, + "expose_exporter": { + "type": "boolean", + "x-nullable": true, + "description": "Optionally expose the exporter process on all public interfaces." + }, + "max_exporter_connections": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Maximum number of connections that exporter can open to the database instance." + } + } + }, + "v1ChangeProxySQLExporterParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "username": { + "type": "string", + "x-nullable": true, + "description": "ProxySQL username for scraping metrics." + }, + "password": { + "type": "string", + "x-nullable": true, + "description": "ProxySQL password for scraping metrics." + }, + "tls": { + "type": "boolean", + "x-nullable": true, + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "x-nullable": true, + "description": "Skip TLS certificate and hostname validation." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "agent_password": { + "type": "string", + "x-nullable": true, + "description": "Custom password for exporter endpoint /metrics." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "x-nullable": true, + "description": "Optionally expose the exporter process on all public interfaces." + } + } + }, + "v1ChangeQANMongoDBMongologAgentParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "username": { + "type": "string", + "x-nullable": true, + "description": "MongoDB username for getting mongolog data." + }, + "password": { + "type": "string", + "x-nullable": true, + "description": "MongoDB password for getting mongolog data." + }, + "tls": { + "type": "boolean", + "x-nullable": true, + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "x-nullable": true, + "description": "Skip TLS certificate and hostname validation." + }, + "tls_certificate_key": { + "type": "string", + "x-nullable": true, + "description": "Client certificate and key." + }, + "tls_certificate_key_file_password": { + "type": "string", + "x-nullable": true, + "description": "Password for decrypting tls_certificate_key." + }, + "tls_ca": { + "type": "string", + "x-nullable": true, + "description": "Certificate Authority certificate chain." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "authentication_mechanism": { + "type": "string", + "x-nullable": true, + "description": "Authentication mechanism." + }, + "authentication_database": { + "type": "string", + "x-nullable": true, + "description": "Authentication database." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + } + } + }, + "v1ChangeQANMongoDBProfilerAgentParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "username": { + "type": "string", + "x-nullable": true, + "description": "MongoDB username for getting profile data." + }, + "password": { + "type": "string", + "x-nullable": true, + "description": "MongoDB password for getting profile data." + }, + "tls": { + "type": "boolean", + "x-nullable": true, + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "x-nullable": true, + "description": "Skip TLS certificate and hostname validation." + }, + "tls_certificate_key": { + "type": "string", + "x-nullable": true, + "description": "Client certificate and key." + }, + "tls_certificate_key_file_password": { + "type": "string", + "x-nullable": true, + "description": "Password for decrypting tls_certificate_key." + }, + "tls_ca": { + "type": "string", + "x-nullable": true, + "description": "Certificate Authority certificate chain." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "authentication_mechanism": { + "type": "string", + "x-nullable": true, + "description": "Authentication mechanism." + }, + "authentication_database": { + "type": "string", + "x-nullable": true, + "description": "Authentication database." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + } + } + }, + "v1ChangeQANMySQLPerfSchemaAgentParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "username": { + "type": "string", + "x-nullable": true, + "description": "MySQL username for getting performance data." + }, + "password": { + "type": "string", + "x-nullable": true, + "description": "MySQL password for getting performance data." + }, + "tls": { + "type": "boolean", + "x-nullable": true, + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "x-nullable": true, + "description": "Skip TLS certificate and hostname validation." + }, + "tls_ca": { + "type": "string", + "x-nullable": true, + "description": "Certificate Authority certificate chain." + }, + "tls_cert": { + "type": "string", + "x-nullable": true, + "description": "Client certificate." + }, + "tls_key": { + "type": "string", + "x-nullable": true, + "description": "Password for decrypting tls_cert." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "disable_query_examples": { + "type": "boolean", + "x-nullable": true, + "description": "Disable query examples." + }, + "skip_connection_check": { + "type": "boolean", + "x-nullable": true, + "description": "Skip connection check." + }, + "disable_comments_parsing": { + "type": "boolean", + "x-nullable": true, + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + } + } + }, + "v1ChangeQANMySQLSlowlogAgentParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "username": { + "type": "string", + "x-nullable": true, + "description": "MySQL username for getting slowlog data." + }, + "password": { + "type": "string", + "x-nullable": true, + "description": "MySQL password for getting slowlog data." + }, + "tls": { + "type": "boolean", + "x-nullable": true, + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "x-nullable": true, + "description": "Skip TLS certificate and hostname validation." + }, + "tls_ca": { + "type": "string", + "x-nullable": true, + "description": "Certificate Authority certificate chain." + }, + "tls_cert": { + "type": "string", + "x-nullable": true, + "description": "Client certificate." + }, + "tls_key": { + "type": "string", + "x-nullable": true, + "description": "Password for decrypting tls_cert." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "disable_query_examples": { + "type": "boolean", + "x-nullable": true, + "description": "Disable query examples." + }, + "max_slowlog_file_size": { + "type": "string", + "format": "int64", + "x-nullable": true, + "description": "Rotate slowlog file at this size if \u003e 0." + }, + "skip_connection_check": { + "type": "boolean", + "x-nullable": true, + "description": "Skip connection check." + }, + "disable_comments_parsing": { + "type": "boolean", + "x-nullable": true, + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + } + } + }, + "v1ChangeQANPostgreSQLPgStatMonitorAgentParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "username": { + "type": "string", + "x-nullable": true, + "description": "PostgreSQL username for getting pg stat monitor data." + }, + "password": { + "type": "string", + "x-nullable": true, + "description": "PostgreSQL password for getting pg stat monitor data." + }, + "tls": { + "type": "boolean", + "x-nullable": true, + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "x-nullable": true, + "description": "Skip TLS certificate and hostname validation." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "disable_query_examples": { + "type": "boolean", + "x-nullable": true, + "description": "Disable query examples." + }, + "disable_comments_parsing": { + "type": "boolean", + "x-nullable": true, + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "tls_ca": { + "type": "string", + "x-nullable": true, + "description": "TLS CA certificate." + }, + "tls_cert": { + "type": "string", + "x-nullable": true, + "description": "TLS Certificate." + }, + "tls_key": { + "type": "string", + "x-nullable": true, + "description": "TLS Certificate Key." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + } + } + }, + "v1ChangeQANPostgreSQLPgStatementsAgentParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "username": { + "type": "string", + "x-nullable": true, + "description": "PostgreSQL username for getting pg stat statements data." + }, + "password": { + "type": "string", + "x-nullable": true, + "description": "PostgreSQL password for getting pg stat statements data." + }, + "tls": { + "type": "boolean", + "x-nullable": true, + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "x-nullable": true, + "description": "Skip TLS certificate and hostname validation." + }, + "disable_comments_parsing": { + "type": "boolean", + "x-nullable": true, + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "tls_ca": { + "type": "string", + "x-nullable": true, + "description": "TLS CA certificate." + }, + "tls_cert": { + "type": "string", + "x-nullable": true, + "description": "TLS Certificate." + }, + "tls_key": { + "type": "string", + "x-nullable": true, + "description": "TLS Certificate Key." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + } + } + }, + "v1ChangeRDSExporterParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "aws_access_key": { + "type": "string", + "x-nullable": true, + "description": "AWS Access Key." + }, + "aws_secret_key": { + "type": "string", + "x-nullable": true, + "description": "AWS Secret Key." + }, + "disable_basic_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Disable basic metrics." + }, + "disable_enhanced_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Disable enhanced metrics." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + } + } + }, + "v1ChangeRTAMongoDBAgentParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + }, + "username": { + "type": "string", + "x-nullable": true, + "description": "MongoDB username for getting profile data." + }, + "password": { + "type": "string", + "x-nullable": true, + "description": "MongoDB password for getting profile data." + }, + "tls": { + "type": "boolean", + "x-nullable": true, + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "x-nullable": true, + "description": "Skip TLS certificate and hostname validation." + }, + "tls_certificate_key": { + "type": "string", + "x-nullable": true, + "description": "Client certificate and key." + }, + "tls_certificate_key_file_password": { + "type": "string", + "x-nullable": true, + "description": "Password for decrypting tls_certificate_key." + }, + "tls_ca": { + "type": "string", + "x-nullable": true, + "description": "Certificate Authority certificate chain." + }, + "authentication_mechanism": { + "type": "string", + "x-nullable": true, + "description": "Authentication mechanism." + }, + "rta_options": { + "$ref": "#/definitions/v1RTAOptions", + "x-nullable": true, + "description": "Real-Time Analytics options." + } + } + }, + "v1ChangeValkeyExporterParams": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "x-nullable": true, + "description": "Enable this Agent. Agents are enabled by default when they get added." + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + }, + "enable_push_metrics": { + "type": "boolean", + "x-nullable": true, + "description": "Enables push metrics with vmagent." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "username": { + "type": "string", + "x-nullable": true, + "description": "Valkey username for scraping metrics." + }, + "password": { + "type": "string", + "x-nullable": true, + "description": "Valkey password for scraping metrics." + }, + "tls": { + "type": "boolean", + "x-nullable": true, + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "x-nullable": true, + "description": "Skip TLS certificate and hostname validation." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "tls_ca": { + "type": "string", + "x-nullable": true, + "description": "TLS CA certificate." + }, + "tls_cert": { + "type": "string", + "x-nullable": true, + "description": "TLS Certifcate." + }, + "tls_key": { + "type": "string", + "x-nullable": true, + "description": "TLS Certificate Key." + }, + "agent_password": { + "type": "string", + "x-nullable": true, + "description": "Custom password for exporter endpoint /metrics." + }, + "expose_exporter": { + "type": "boolean", + "x-nullable": true, + "title": "Optionally expose the exporter process on all public interfaces" + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "x-nullable": true, + "description": "Log level for exporter." + } + } + }, + "v1ExternalExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "runs_on_node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "disabled": { + "type": "boolean", + "description": "If disabled, metrics from this exporter will not be collected." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "HTTP basic auth username for collecting metrics." + }, + "scheme": { + "type": "string", + "description": "Scheme to generate URI to exporter metrics endpoints." + }, + "metrics_path": { + "type": "string", + "description": "Path under which metrics are exposed, used to generate URI." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname verification." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + } + }, + "description": "ExternalExporter runs on any Node type, including Remote Node." + }, + "v1GetAgentLogsResponse": { + "type": "object", + "properties": { + "logs": { + "type": "array", + "items": { + "type": "string" + } + }, + "agent_config_log_lines_count": { + "type": "integer", + "format": "int64" + } + } + }, + "v1GetAgentResponse": { + "type": "object", + "properties": { + "pmm_agent": { + "$ref": "#/definitions/v1PMMAgent" + }, + "vmagent": { + "$ref": "#/definitions/v1VMAgent" + }, + "node_exporter": { + "$ref": "#/definitions/v1NodeExporter" + }, + "mysqld_exporter": { + "$ref": "#/definitions/v1MySQLdExporter" + }, + "mongodb_exporter": { + "$ref": "#/definitions/v1MongoDBExporter" + }, + "postgres_exporter": { + "$ref": "#/definitions/v1PostgresExporter" + }, + "proxysql_exporter": { + "$ref": "#/definitions/v1ProxySQLExporter" + }, + "qan_mysql_perfschema_agent": { + "$ref": "#/definitions/v1QANMySQLPerfSchemaAgent" + }, + "qan_mysql_slowlog_agent": { + "$ref": "#/definitions/v1QANMySQLSlowlogAgent" + }, + "qan_mongodb_profiler_agent": { + "$ref": "#/definitions/v1QANMongoDBProfilerAgent" + }, + "qan_mongodb_mongolog_agent": { + "$ref": "#/definitions/v1QANMongoDBMongologAgent" + }, + "qan_postgresql_pgstatements_agent": { + "$ref": "#/definitions/v1QANPostgreSQLPgStatementsAgent" + }, + "qan_postgresql_pgstatmonitor_agent": { + "$ref": "#/definitions/v1QANPostgreSQLPgStatMonitorAgent" + }, + "external_exporter": { + "$ref": "#/definitions/v1ExternalExporter" + }, + "rds_exporter": { + "$ref": "#/definitions/v1RDSExporter" + }, + "azure_database_exporter": { + "$ref": "#/definitions/v1AzureDatabaseExporter" + }, + "nomad_agent": { + "$ref": "#/definitions/v1NomadAgent" + }, + "valkey_exporter": { + "$ref": "#/definitions/v1ValkeyExporter" + }, + "rta_mongodb_agent": { + "$ref": "#/definitions/v1RTAMongoDBAgent" + } + } + }, + "v1ListAgentsResponse": { + "type": "object", + "properties": { + "pmm_agent": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PMMAgent" + } + }, + "vm_agent": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1VMAgent" + } + }, + "node_exporter": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1NodeExporter" + } + }, + "mysqld_exporter": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1MySQLdExporter" + } + }, + "mongodb_exporter": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1MongoDBExporter" + } + }, + "postgres_exporter": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PostgresExporter" + } + }, + "proxysql_exporter": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ProxySQLExporter" + } + }, + "qan_mysql_perfschema_agent": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1QANMySQLPerfSchemaAgent" + } + }, + "qan_mysql_slowlog_agent": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1QANMySQLSlowlogAgent" + } + }, + "qan_mongodb_profiler_agent": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1QANMongoDBProfilerAgent" + } + }, + "qan_mongodb_mongolog_agent": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1QANMongoDBMongologAgent" + } + }, + "qan_postgresql_pgstatements_agent": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1QANPostgreSQLPgStatementsAgent" + } + }, + "qan_postgresql_pgstatmonitor_agent": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1QANPostgreSQLPgStatMonitorAgent" + } + }, + "external_exporter": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ExternalExporter" + } + }, + "rds_exporter": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RDSExporter" + } + }, + "azure_database_exporter": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AzureDatabaseExporter" + } + }, + "nomad_agent": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1NomadAgent" + } + }, + "valkey_exporter": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ValkeyExporter" + } + }, + "rta_mongodb_agent": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RTAMongoDBAgent" + } + } + } + }, + "v1LogLevel": { + "type": "string", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "default": "LOG_LEVEL_UNSPECIFIED", + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "title": "Log level for exporters" + }, + "v1MongoDBExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MongoDB username for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "disabled_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of disabled collector names." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "stats_collections": { + "type": "array", + "items": { + "type": "string" + }, + "title": "List of colletions to get stats from. Can use *" + }, + "collections_limit": { + "type": "integer", + "format": "int32", + "title": "Collections limit. Only get Databases and collection stats if the total number of collections in the server\nis less than this value. 0: no limit" + }, + "enable_all_collectors": { + "type": "boolean", + "description": "Enable all collectors." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "environment_variable_names": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Environment variable names passed to the exporter." + } + }, + "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics." + }, + "v1MySQLdExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MySQL username for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "tls_cert": { + "type": "string", + "description": "Client certificate." + }, + "tls_key": { + "type": "string", + "description": "Password for decrypting tls_cert." + }, + "tablestats_group_table_limit": { + "type": "integer", + "format": "int32", + "description": "Tablestats group collectors are disabled if there are more than that number of tables.\n0 means tablestats group collectors are always enabled (no limit).\nNegative value means tablestats group collectors are always disabled." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "disabled_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of disabled collector names." + }, + "table_count": { + "type": "integer", + "format": "int32", + "description": "Actual table count at the moment of adding." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "tablestats_group_disabled": { + "type": "boolean", + "description": "True if tablestats group collectors are currently disabled." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra DSN parameters for MySQL connection." + } + }, + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics." + }, + "v1NodeExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "disabled_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of disabled collector names." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + } + }, + "description": "NodeExporter runs on Generic or Container Node and exposes its metrics." + }, + "v1NomadAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + } + } + }, + "v1PMMAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "runs_on_node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "connected": { + "type": "boolean", + "description": "True if Agent is running and connected to pmm-managed." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + } + }, + "description": "PMMAgent runs on Generic or Container Node." + }, + "v1PostgresExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "PostgreSQL username for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "disabled_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of disabled collector names." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "auto_discovery_limit": { + "type": "integer", + "format": "int32", + "description": "Limit of databases for auto-discovery." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "max_exporter_connections": { + "type": "integer", + "format": "int32", + "description": "Maximum number of connections that exporter can open to the database instance." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + } + }, + "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics." + }, + "v1ProxySQLExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "ProxySQL username for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "disabled_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of disabled collector names." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + } + }, + "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics." + }, + "v1QANMongoDBMongologAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MongoDB username for getting profiler data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + }, + "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server." + }, + "v1QANMongoDBProfilerAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MongoDB username for getting profiler data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + }, + "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server." + }, + "v1QANMySQLPerfSchemaAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MySQL username for getting performance data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "tls_cert": { + "type": "string", + "description": "Client certificate." + }, + "tls_key": { + "type": "string", + "description": "Password for decrypting tls_cert." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "query_examples_disabled": { + "type": "boolean", + "description": "True if query examples are disabled." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra DSN parameters for MySQL connection." + } + }, + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server." + }, + "v1QANMySQLSlowlogAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MySQL username for getting performance data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "tls_cert": { + "type": "string", + "description": "Client certificate." + }, + "tls_key": { + "type": "string", + "description": "Password for decrypting tls_cert." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "title": "Limit query length in QAN (default: server-defined; -1: no limit)" + }, + "query_examples_disabled": { + "type": "boolean", + "description": "True if query examples are disabled." + }, + "max_slowlog_file_size": { + "type": "string", + "format": "int64", + "description": "Slowlog file is rotated at this size if \u003e 0." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "title": "mod tidy" + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra DSN parameters for MySQL connection." + } + }, + "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server." + }, + "v1QANPostgreSQLPgStatMonitorAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "PostgreSQL username for getting pg stat monitor data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "query_examples_disabled": { + "type": "boolean", + "description": "True if query examples are disabled." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + }, + "description": "QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server." + }, + "v1QANPostgreSQLPgStatementsAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "PostgreSQL username for getting pg stat statements data." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + }, + "description": "QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server." + }, + "v1RDSExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "node_id": { + "type": "string", + "description": "Node identifier." + }, + "aws_access_key": { + "type": "string", + "description": "AWS Access Key." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status (the same for several configurations)." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics (the same for several configurations)." + }, + "basic_metrics_disabled": { + "type": "boolean", + "description": "Basic metrics are disabled." + }, + "enhanced_metrics_disabled": { + "type": "boolean", + "description": "Enhanced metrics are disabled." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "auto_discovery_limit": { + "type": "integer", + "format": "int32", + "description": "Limit of databases for auto-discovery." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + } + }, + "description": "RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics." + }, + "v1RTAMongoDBAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique agent identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MongoDB username for getting profiler data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "rta_options": { + "$ref": "#/definitions/v1RTAOptions", + "description": "Real-Time Analytics options." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + }, + "description": "RTAMongoDBAgent runs within pmm-agent and sends MongoDB Real-Time Query Analytics data to the PMM Server." + }, + "v1RTAOptions": { + "type": "object", + "properties": { + "collect_interval": { + "type": "string", + "description": "Query collect interval (default 2s is set by server)." + } + }, + "description": "RTAOptions holds Real-Time Query Analytics agent options." + }, + "v1RemoveAgentResponse": { + "type": "object" + }, + "v1VMAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + } + }, + "description": "VMAgent runs on Generic or Container Node alongside pmm-agent.\nIt scrapes other exporter Agents that are configured with push_metrics_enabled\nand uses Prometheus remote write protocol to push metrics to PMM Server." + }, + "v1ValkeyExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "Valkey username for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname verification." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "disabled_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of disabled collector names." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + } + }, + "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey Service metrics." + } + } +} diff --git a/api/inventory/v1/agents_grpc.pb.go b/api/inventory/v1/agents_grpc.pb.go index 0b4c6fc63e1..bfb234718bc 100644 --- a/api/inventory/v1/agents_grpc.pb.go +++ b/api/inventory/v1/agents_grpc.pb.go @@ -8,7 +8,6 @@ package inventoryv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -147,23 +146,18 @@ type UnimplementedAgentsServiceServer struct{} func (UnimplementedAgentsServiceServer) ListAgents(context.Context, *ListAgentsRequest) (*ListAgentsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAgents not implemented") } - func (UnimplementedAgentsServiceServer) GetAgent(context.Context, *GetAgentRequest) (*GetAgentResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetAgent not implemented") } - func (UnimplementedAgentsServiceServer) GetAgentLogs(context.Context, *GetAgentLogsRequest) (*GetAgentLogsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetAgentLogs not implemented") } - func (UnimplementedAgentsServiceServer) AddAgent(context.Context, *AddAgentRequest) (*AddAgentResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddAgent not implemented") } - func (UnimplementedAgentsServiceServer) ChangeAgent(context.Context, *ChangeAgentRequest) (*ChangeAgentResponse, error) { return nil, status.Error(codes.Unimplemented, "method ChangeAgent not implemented") } - func (UnimplementedAgentsServiceServer) RemoveAgent(context.Context, *RemoveAgentRequest) (*RemoveAgentResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveAgent not implemented") } diff --git a/api/inventory/v1/log_level.pb.go b/api/inventory/v1/log_level.pb.go index cd798d6fb86..16defbb9016 100644 --- a/api/inventory/v1/log_level.pb.go +++ b/api/inventory/v1/log_level.pb.go @@ -7,12 +7,11 @@ package inventoryv1 import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -108,13 +107,10 @@ func file_inventory_v1_log_level_proto_rawDescGZIP() []byte { return file_inventory_v1_log_level_proto_rawDescData } -var ( - file_inventory_v1_log_level_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_inventory_v1_log_level_proto_goTypes = []any{ - (LogLevel)(0), // 0: inventory.v1.LogLevel - } -) - +var file_inventory_v1_log_level_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_inventory_v1_log_level_proto_goTypes = []any{ + (LogLevel)(0), // 0: inventory.v1.LogLevel +} var file_inventory_v1_log_level_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/inventory/v1/log_level.swagger.json b/api/inventory/v1/log_level.swagger.json new file mode 100644 index 00000000000..0e16c21a9e1 --- /dev/null +++ b/api/inventory/v1/log_level.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "inventory/v1/log_level.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/inventory/v1/nodes.pb.go b/api/inventory/v1/nodes.pb.go index 672f9e43761..7391959ad03 100644 --- a/api/inventory/v1/nodes.pb.go +++ b/api/inventory/v1/nodes.pb.go @@ -7,15 +7,14 @@ package inventoryv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -2008,42 +2007,39 @@ func file_inventory_v1_nodes_proto_rawDescGZIP() []byte { return file_inventory_v1_nodes_proto_rawDescData } -var ( - file_inventory_v1_nodes_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_inventory_v1_nodes_proto_msgTypes = make([]protoimpl.MessageInfo, 28) - file_inventory_v1_nodes_proto_goTypes = []any{ - (NodeType)(0), // 0: inventory.v1.NodeType - (*GenericNode)(nil), // 1: inventory.v1.GenericNode - (*ContainerNode)(nil), // 2: inventory.v1.ContainerNode - (*RemoteNode)(nil), // 3: inventory.v1.RemoteNode - (*RemoteRDSNode)(nil), // 4: inventory.v1.RemoteRDSNode - (*RemoteAzureDatabaseNode)(nil), // 5: inventory.v1.RemoteAzureDatabaseNode - (*ListNodesRequest)(nil), // 6: inventory.v1.ListNodesRequest - (*ListNodesResponse)(nil), // 7: inventory.v1.ListNodesResponse - (*GetNodeRequest)(nil), // 8: inventory.v1.GetNodeRequest - (*GetNodeResponse)(nil), // 9: inventory.v1.GetNodeResponse - (*AddNodeRequest)(nil), // 10: inventory.v1.AddNodeRequest - (*AddNodeResponse)(nil), // 11: inventory.v1.AddNodeResponse - (*AddGenericNodeParams)(nil), // 12: inventory.v1.AddGenericNodeParams - (*AddContainerNodeParams)(nil), // 13: inventory.v1.AddContainerNodeParams - (*AddRemoteNodeParams)(nil), // 14: inventory.v1.AddRemoteNodeParams - (*AddRemoteRDSNodeParams)(nil), // 15: inventory.v1.AddRemoteRDSNodeParams - (*AddRemoteAzureNodeParams)(nil), // 16: inventory.v1.AddRemoteAzureNodeParams - (*RemoveNodeRequest)(nil), // 17: inventory.v1.RemoveNodeRequest - (*RemoveNodeResponse)(nil), // 18: inventory.v1.RemoveNodeResponse - nil, // 19: inventory.v1.GenericNode.CustomLabelsEntry - nil, // 20: inventory.v1.ContainerNode.CustomLabelsEntry - nil, // 21: inventory.v1.RemoteNode.CustomLabelsEntry - nil, // 22: inventory.v1.RemoteRDSNode.CustomLabelsEntry - nil, // 23: inventory.v1.RemoteAzureDatabaseNode.CustomLabelsEntry - nil, // 24: inventory.v1.AddGenericNodeParams.CustomLabelsEntry - nil, // 25: inventory.v1.AddContainerNodeParams.CustomLabelsEntry - nil, // 26: inventory.v1.AddRemoteNodeParams.CustomLabelsEntry - nil, // 27: inventory.v1.AddRemoteRDSNodeParams.CustomLabelsEntry - nil, // 28: inventory.v1.AddRemoteAzureNodeParams.CustomLabelsEntry - } -) - +var file_inventory_v1_nodes_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_inventory_v1_nodes_proto_msgTypes = make([]protoimpl.MessageInfo, 28) +var file_inventory_v1_nodes_proto_goTypes = []any{ + (NodeType)(0), // 0: inventory.v1.NodeType + (*GenericNode)(nil), // 1: inventory.v1.GenericNode + (*ContainerNode)(nil), // 2: inventory.v1.ContainerNode + (*RemoteNode)(nil), // 3: inventory.v1.RemoteNode + (*RemoteRDSNode)(nil), // 4: inventory.v1.RemoteRDSNode + (*RemoteAzureDatabaseNode)(nil), // 5: inventory.v1.RemoteAzureDatabaseNode + (*ListNodesRequest)(nil), // 6: inventory.v1.ListNodesRequest + (*ListNodesResponse)(nil), // 7: inventory.v1.ListNodesResponse + (*GetNodeRequest)(nil), // 8: inventory.v1.GetNodeRequest + (*GetNodeResponse)(nil), // 9: inventory.v1.GetNodeResponse + (*AddNodeRequest)(nil), // 10: inventory.v1.AddNodeRequest + (*AddNodeResponse)(nil), // 11: inventory.v1.AddNodeResponse + (*AddGenericNodeParams)(nil), // 12: inventory.v1.AddGenericNodeParams + (*AddContainerNodeParams)(nil), // 13: inventory.v1.AddContainerNodeParams + (*AddRemoteNodeParams)(nil), // 14: inventory.v1.AddRemoteNodeParams + (*AddRemoteRDSNodeParams)(nil), // 15: inventory.v1.AddRemoteRDSNodeParams + (*AddRemoteAzureNodeParams)(nil), // 16: inventory.v1.AddRemoteAzureNodeParams + (*RemoveNodeRequest)(nil), // 17: inventory.v1.RemoveNodeRequest + (*RemoveNodeResponse)(nil), // 18: inventory.v1.RemoveNodeResponse + nil, // 19: inventory.v1.GenericNode.CustomLabelsEntry + nil, // 20: inventory.v1.ContainerNode.CustomLabelsEntry + nil, // 21: inventory.v1.RemoteNode.CustomLabelsEntry + nil, // 22: inventory.v1.RemoteRDSNode.CustomLabelsEntry + nil, // 23: inventory.v1.RemoteAzureDatabaseNode.CustomLabelsEntry + nil, // 24: inventory.v1.AddGenericNodeParams.CustomLabelsEntry + nil, // 25: inventory.v1.AddContainerNodeParams.CustomLabelsEntry + nil, // 26: inventory.v1.AddRemoteNodeParams.CustomLabelsEntry + nil, // 27: inventory.v1.AddRemoteRDSNodeParams.CustomLabelsEntry + nil, // 28: inventory.v1.AddRemoteAzureNodeParams.CustomLabelsEntry +} var file_inventory_v1_nodes_proto_depIdxs = []int32{ 19, // 0: inventory.v1.GenericNode.custom_labels:type_name -> inventory.v1.GenericNode.CustomLabelsEntry 20, // 1: inventory.v1.ContainerNode.custom_labels:type_name -> inventory.v1.ContainerNode.CustomLabelsEntry diff --git a/api/inventory/v1/nodes.swagger.json b/api/inventory/v1/nodes.swagger.json new file mode 100644 index 00000000000..32958ba155f --- /dev/null +++ b/api/inventory/v1/nodes.swagger.json @@ -0,0 +1,708 @@ +{ + "swagger": "2.0", + "info": { + "title": "inventory/v1/nodes.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "NodesService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/inventory/nodes": { + "get": { + "summary": "List Nodes", + "description": "Returns a list of all Nodes.", + "operationId": "ListNodes", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListNodesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "node_type", + "description": "Return only Nodes with matching Node type.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ], + "default": "NODE_TYPE_UNSPECIFIED" + } + ], + "tags": [ + "NodesService" + ] + }, + "post": { + "summary": "Add a Node", + "description": "Adds a Node.", + "operationId": "AddNode", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1AddNodeResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1AddNodeRequest" + } + } + ], + "tags": [ + "NodesService" + ] + } + }, + "/v1/inventory/nodes/{node_id}": { + "get": { + "summary": "Get a Node", + "description": "Returns a single Node by ID.", + "operationId": "GetNode", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetNodeResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "node_id", + "description": "Unique randomly generated instance identifier.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "NodesService" + ] + }, + "delete": { + "summary": "Remove a Node", + "description": "Removes a Node.", + "operationId": "RemoveNode", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RemoveNodeResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "node_id", + "description": "Unique randomly generated instance identifier.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "force", + "description": "Remove node with all dependencies.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "NodesService" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1AddContainerNodeParams": { + "type": "object", + "properties": { + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "address": { + "type": "string", + "description": "Node address (DNS name or IP)." + }, + "machine_id": { + "type": "string", + "description": "Linux machine-id of the Generic Node where this Container Node runs." + }, + "container_id": { + "type": "string", + "description": "Container identifier. If specified, must be a unique Docker container identifier." + }, + "container_name": { + "type": "string", + "description": "Container name." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + } + }, + "v1AddGenericNodeParams": { + "type": "object", + "properties": { + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "address": { + "type": "string", + "description": "Node address (DNS name or IP)." + }, + "machine_id": { + "type": "string", + "description": "Linux machine-id." + }, + "distro": { + "type": "string", + "description": "Linux distribution name and version." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + } + }, + "v1AddNodeRequest": { + "type": "object", + "properties": { + "generic": { + "$ref": "#/definitions/v1AddGenericNodeParams" + }, + "container": { + "$ref": "#/definitions/v1AddContainerNodeParams" + }, + "remote": { + "$ref": "#/definitions/v1AddRemoteNodeParams" + }, + "remote_rds": { + "$ref": "#/definitions/v1AddRemoteRDSNodeParams" + }, + "remote_azure": { + "$ref": "#/definitions/v1AddRemoteAzureNodeParams" + } + } + }, + "v1AddNodeResponse": { + "type": "object", + "properties": { + "generic": { + "$ref": "#/definitions/v1GenericNode" + }, + "container": { + "$ref": "#/definitions/v1ContainerNode" + }, + "remote": { + "$ref": "#/definitions/v1RemoteNode" + }, + "remote_rds": { + "$ref": "#/definitions/v1RemoteRDSNode" + }, + "remote_azure_database": { + "$ref": "#/definitions/v1RemoteAzureDatabaseNode" + } + } + }, + "v1AddRemoteAzureNodeParams": { + "type": "object", + "properties": { + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "address": { + "type": "string", + "description": "DB instance identifier." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + } + }, + "v1AddRemoteNodeParams": { + "type": "object", + "properties": { + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "address": { + "type": "string", + "description": "Node address (DNS name or IP)." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + } + }, + "v1AddRemoteRDSNodeParams": { + "type": "object", + "properties": { + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "address": { + "type": "string", + "description": "DB instance identifier." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + } + }, + "v1ContainerNode": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "address": { + "type": "string", + "description": "Node address (DNS name or IP)." + }, + "machine_id": { + "type": "string", + "description": "Linux machine-id of the Generic Node where this Container Node runs." + }, + "container_id": { + "type": "string", + "description": "Container identifier. If specified, must be a unique Docker container identifier." + }, + "container_name": { + "type": "string", + "description": "Container name." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "is_pmm_server_node": { + "type": "boolean", + "description": "True if this node is a PMM Server node (HA mode)." + } + }, + "description": "ContainerNode represents a Docker container." + }, + "v1GenericNode": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "address": { + "type": "string", + "description": "Node address (DNS name or IP)." + }, + "machine_id": { + "type": "string", + "description": "Linux machine-id." + }, + "distro": { + "type": "string", + "description": "Linux distribution name and version." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "is_pmm_server_node": { + "type": "boolean", + "description": "True if this node is a PMM Server node (HA mode)." + } + }, + "description": "GenericNode represents a bare metal server or virtual machine." + }, + "v1GetNodeResponse": { + "type": "object", + "properties": { + "generic": { + "$ref": "#/definitions/v1GenericNode" + }, + "container": { + "$ref": "#/definitions/v1ContainerNode" + }, + "remote": { + "$ref": "#/definitions/v1RemoteNode" + }, + "remote_rds": { + "$ref": "#/definitions/v1RemoteRDSNode" + }, + "remote_azure_database": { + "$ref": "#/definitions/v1RemoteAzureDatabaseNode" + } + } + }, + "v1ListNodesResponse": { + "type": "object", + "properties": { + "generic": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1GenericNode" + } + }, + "container": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ContainerNode" + } + }, + "remote": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RemoteNode" + } + }, + "remote_rds": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RemoteRDSNode" + } + }, + "remote_azure_database": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RemoteAzureDatabaseNode" + } + } + } + }, + "v1NodeType": { + "type": "string", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ], + "default": "NODE_TYPE_UNSPECIFIED", + "description": "NodeType describes supported Node types." + }, + "v1RemoteAzureDatabaseNode": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "address": { + "type": "string", + "description": "DB instance identifier." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + }, + "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes." + }, + "v1RemoteNode": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "address": { + "type": "string", + "description": "Node address (DNS name or IP)." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + }, + "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." + }, + "v1RemoteRDSNode": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "address": { + "type": "string", + "description": "DB instance identifier." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "instance_id": { + "type": "string", + "description": "AWS instance ID." + } + }, + "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes." + }, + "v1RemoveNodeResponse": { + "type": "object" + } + } +} diff --git a/api/inventory/v1/nodes_grpc.pb.go b/api/inventory/v1/nodes_grpc.pb.go index 7142c1b4a15..14c8f370438 100644 --- a/api/inventory/v1/nodes_grpc.pb.go +++ b/api/inventory/v1/nodes_grpc.pb.go @@ -8,7 +8,6 @@ package inventoryv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -117,15 +116,12 @@ type UnimplementedNodesServiceServer struct{} func (UnimplementedNodesServiceServer) ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListNodes not implemented") } - func (UnimplementedNodesServiceServer) GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetNode not implemented") } - func (UnimplementedNodesServiceServer) AddNode(context.Context, *AddNodeRequest) (*AddNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddNode not implemented") } - func (UnimplementedNodesServiceServer) RemoveNode(context.Context, *RemoveNodeRequest) (*RemoveNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveNode not implemented") } diff --git a/api/inventory/v1/services.pb.go b/api/inventory/v1/services.pb.go index 0ca7d8acb26..d1a54903862 100644 --- a/api/inventory/v1/services.pb.go +++ b/api/inventory/v1/services.pb.go @@ -7,17 +7,15 @@ package inventoryv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + common "github.com/percona/pmm/api/common" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - common "github.com/percona/pmm/api/common" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -3284,57 +3282,54 @@ func file_inventory_v1_services_proto_rawDescGZIP() []byte { return file_inventory_v1_services_proto_rawDescData } -var ( - file_inventory_v1_services_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_inventory_v1_services_proto_msgTypes = make([]protoimpl.MessageInfo, 42) - file_inventory_v1_services_proto_goTypes = []any{ - (ServiceType)(0), // 0: inventory.v1.ServiceType - (*MySQLService)(nil), // 1: inventory.v1.MySQLService - (*MongoDBService)(nil), // 2: inventory.v1.MongoDBService - (*PostgreSQLService)(nil), // 3: inventory.v1.PostgreSQLService - (*ValkeyService)(nil), // 4: inventory.v1.ValkeyService - (*ProxySQLService)(nil), // 5: inventory.v1.ProxySQLService - (*HAProxyService)(nil), // 6: inventory.v1.HAProxyService - (*ExternalService)(nil), // 7: inventory.v1.ExternalService - (*ListServicesRequest)(nil), // 8: inventory.v1.ListServicesRequest - (*ListServicesResponse)(nil), // 9: inventory.v1.ListServicesResponse - (*ListActiveServiceTypesRequest)(nil), // 10: inventory.v1.ListActiveServiceTypesRequest - (*ListActiveServiceTypesResponse)(nil), // 11: inventory.v1.ListActiveServiceTypesResponse - (*GetServiceRequest)(nil), // 12: inventory.v1.GetServiceRequest - (*GetServiceResponse)(nil), // 13: inventory.v1.GetServiceResponse - (*AddServiceRequest)(nil), // 14: inventory.v1.AddServiceRequest - (*AddServiceResponse)(nil), // 15: inventory.v1.AddServiceResponse - (*AddMySQLServiceParams)(nil), // 16: inventory.v1.AddMySQLServiceParams - (*AddMongoDBServiceParams)(nil), // 17: inventory.v1.AddMongoDBServiceParams - (*AddPostgreSQLServiceParams)(nil), // 18: inventory.v1.AddPostgreSQLServiceParams - (*AddValkeyServiceParams)(nil), // 19: inventory.v1.AddValkeyServiceParams - (*AddProxySQLServiceParams)(nil), // 20: inventory.v1.AddProxySQLServiceParams - (*AddHAProxyServiceParams)(nil), // 21: inventory.v1.AddHAProxyServiceParams - (*AddExternalServiceParams)(nil), // 22: inventory.v1.AddExternalServiceParams - (*RemoveServiceRequest)(nil), // 23: inventory.v1.RemoveServiceRequest - (*RemoveServiceResponse)(nil), // 24: inventory.v1.RemoveServiceResponse - (*ChangeServiceRequest)(nil), // 25: inventory.v1.ChangeServiceRequest - (*ChangeServiceResponse)(nil), // 26: inventory.v1.ChangeServiceResponse - nil, // 27: inventory.v1.MySQLService.CustomLabelsEntry - nil, // 28: inventory.v1.MySQLService.ExtraDsnParamsEntry - nil, // 29: inventory.v1.MongoDBService.CustomLabelsEntry - nil, // 30: inventory.v1.PostgreSQLService.CustomLabelsEntry - nil, // 31: inventory.v1.ValkeyService.CustomLabelsEntry - nil, // 32: inventory.v1.ProxySQLService.CustomLabelsEntry - nil, // 33: inventory.v1.HAProxyService.CustomLabelsEntry - nil, // 34: inventory.v1.ExternalService.CustomLabelsEntry - nil, // 35: inventory.v1.AddMySQLServiceParams.CustomLabelsEntry - nil, // 36: inventory.v1.AddMySQLServiceParams.ExtraDsnParamsEntry - nil, // 37: inventory.v1.AddMongoDBServiceParams.CustomLabelsEntry - nil, // 38: inventory.v1.AddPostgreSQLServiceParams.CustomLabelsEntry - nil, // 39: inventory.v1.AddValkeyServiceParams.CustomLabelsEntry - nil, // 40: inventory.v1.AddProxySQLServiceParams.CustomLabelsEntry - nil, // 41: inventory.v1.AddHAProxyServiceParams.CustomLabelsEntry - nil, // 42: inventory.v1.AddExternalServiceParams.CustomLabelsEntry - (*common.StringMap)(nil), // 43: common.StringMap - } -) - +var file_inventory_v1_services_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_inventory_v1_services_proto_msgTypes = make([]protoimpl.MessageInfo, 42) +var file_inventory_v1_services_proto_goTypes = []any{ + (ServiceType)(0), // 0: inventory.v1.ServiceType + (*MySQLService)(nil), // 1: inventory.v1.MySQLService + (*MongoDBService)(nil), // 2: inventory.v1.MongoDBService + (*PostgreSQLService)(nil), // 3: inventory.v1.PostgreSQLService + (*ValkeyService)(nil), // 4: inventory.v1.ValkeyService + (*ProxySQLService)(nil), // 5: inventory.v1.ProxySQLService + (*HAProxyService)(nil), // 6: inventory.v1.HAProxyService + (*ExternalService)(nil), // 7: inventory.v1.ExternalService + (*ListServicesRequest)(nil), // 8: inventory.v1.ListServicesRequest + (*ListServicesResponse)(nil), // 9: inventory.v1.ListServicesResponse + (*ListActiveServiceTypesRequest)(nil), // 10: inventory.v1.ListActiveServiceTypesRequest + (*ListActiveServiceTypesResponse)(nil), // 11: inventory.v1.ListActiveServiceTypesResponse + (*GetServiceRequest)(nil), // 12: inventory.v1.GetServiceRequest + (*GetServiceResponse)(nil), // 13: inventory.v1.GetServiceResponse + (*AddServiceRequest)(nil), // 14: inventory.v1.AddServiceRequest + (*AddServiceResponse)(nil), // 15: inventory.v1.AddServiceResponse + (*AddMySQLServiceParams)(nil), // 16: inventory.v1.AddMySQLServiceParams + (*AddMongoDBServiceParams)(nil), // 17: inventory.v1.AddMongoDBServiceParams + (*AddPostgreSQLServiceParams)(nil), // 18: inventory.v1.AddPostgreSQLServiceParams + (*AddValkeyServiceParams)(nil), // 19: inventory.v1.AddValkeyServiceParams + (*AddProxySQLServiceParams)(nil), // 20: inventory.v1.AddProxySQLServiceParams + (*AddHAProxyServiceParams)(nil), // 21: inventory.v1.AddHAProxyServiceParams + (*AddExternalServiceParams)(nil), // 22: inventory.v1.AddExternalServiceParams + (*RemoveServiceRequest)(nil), // 23: inventory.v1.RemoveServiceRequest + (*RemoveServiceResponse)(nil), // 24: inventory.v1.RemoveServiceResponse + (*ChangeServiceRequest)(nil), // 25: inventory.v1.ChangeServiceRequest + (*ChangeServiceResponse)(nil), // 26: inventory.v1.ChangeServiceResponse + nil, // 27: inventory.v1.MySQLService.CustomLabelsEntry + nil, // 28: inventory.v1.MySQLService.ExtraDsnParamsEntry + nil, // 29: inventory.v1.MongoDBService.CustomLabelsEntry + nil, // 30: inventory.v1.PostgreSQLService.CustomLabelsEntry + nil, // 31: inventory.v1.ValkeyService.CustomLabelsEntry + nil, // 32: inventory.v1.ProxySQLService.CustomLabelsEntry + nil, // 33: inventory.v1.HAProxyService.CustomLabelsEntry + nil, // 34: inventory.v1.ExternalService.CustomLabelsEntry + nil, // 35: inventory.v1.AddMySQLServiceParams.CustomLabelsEntry + nil, // 36: inventory.v1.AddMySQLServiceParams.ExtraDsnParamsEntry + nil, // 37: inventory.v1.AddMongoDBServiceParams.CustomLabelsEntry + nil, // 38: inventory.v1.AddPostgreSQLServiceParams.CustomLabelsEntry + nil, // 39: inventory.v1.AddValkeyServiceParams.CustomLabelsEntry + nil, // 40: inventory.v1.AddProxySQLServiceParams.CustomLabelsEntry + nil, // 41: inventory.v1.AddHAProxyServiceParams.CustomLabelsEntry + nil, // 42: inventory.v1.AddExternalServiceParams.CustomLabelsEntry + (*common.StringMap)(nil), // 43: common.StringMap +} var file_inventory_v1_services_proto_depIdxs = []int32{ 27, // 0: inventory.v1.MySQLService.custom_labels:type_name -> inventory.v1.MySQLService.CustomLabelsEntry 28, // 1: inventory.v1.MySQLService.extra_dsn_params:type_name -> inventory.v1.MySQLService.ExtraDsnParamsEntry diff --git a/api/inventory/v1/services.pb.validate.go b/api/inventory/v1/services.pb.validate.go index 79783d70e5d..6f939fb5f8f 100644 --- a/api/inventory/v1/services.pb.validate.go +++ b/api/inventory/v1/services.pb.validate.go @@ -4062,6 +4062,7 @@ func (m *ChangeServiceRequest) validate(all bool) error { } if m.CustomLabels != nil { + if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -4090,6 +4091,7 @@ func (m *ChangeServiceRequest) validate(all bool) error { } } } + } if len(errors) > 0 { diff --git a/api/inventory/v1/services.swagger.json b/api/inventory/v1/services.swagger.json new file mode 100644 index 00000000000..ab118f837ff --- /dev/null +++ b/api/inventory/v1/services.swagger.json @@ -0,0 +1,1189 @@ +{ + "swagger": "2.0", + "info": { + "title": "inventory/v1/services.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "ServicesService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/inventory/services": { + "get": { + "summary": "List Services", + "description": "Returns a list of Services filtered by type.", + "operationId": "ListServices", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListServicesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "node_id", + "description": "Return only Services running on that Node.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "service_type", + "description": "Return only services filtered by service type.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "SERVICE_TYPE_UNSPECIFIED", + "SERVICE_TYPE_MYSQL_SERVICE", + "SERVICE_TYPE_MONGODB_SERVICE", + "SERVICE_TYPE_POSTGRESQL_SERVICE", + "SERVICE_TYPE_VALKEY_SERVICE", + "SERVICE_TYPE_PROXYSQL_SERVICE", + "SERVICE_TYPE_HAPROXY_SERVICE", + "SERVICE_TYPE_EXTERNAL_SERVICE" + ], + "default": "SERVICE_TYPE_UNSPECIFIED" + }, + { + "name": "external_group", + "description": "Return only services in this external group.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "ServicesService" + ] + }, + "post": { + "summary": "Add a Service", + "description": "Adds a Service.", + "operationId": "AddService", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1AddServiceResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1AddServiceRequest" + } + } + ], + "tags": [ + "ServicesService" + ] + } + }, + "/v1/inventory/services/{service_id}": { + "get": { + "summary": "Get a Service", + "description": "Returns a single Service by ID.", + "operationId": "GetService", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetServiceResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "service_id", + "description": "Unique randomly generated instance identifier.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "ServicesService" + ] + }, + "delete": { + "summary": "Remove Service", + "description": "Removes Service.", + "operationId": "RemoveService", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RemoveServiceResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "service_id", + "description": "Unique randomly generated instance identifier. Required.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "force", + "description": "Remove service with all dependencies.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "ServicesService" + ] + }, + "put": { + "summary": "Change service", + "description": "Changes service configuration. If a new cluster label is specified, it removes all backup/restore tasks scheduled for the related services. Fails if there are running backup/restore tasks.", + "operationId": "ChangeService", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ChangeServiceResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "service_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ServicesServiceChangeServiceBody" + } + } + ], + "tags": [ + "ServicesService" + ] + } + }, + "/v1/inventory/services:getTypes": { + "post": { + "summary": "List Active Service Types", + "description": "Returns a list of active Service types.", + "operationId": "ListActiveServiceTypes", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListActiveServiceTypesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ListActiveServiceTypesRequest" + } + } + ], + "tags": [ + "ServicesService" + ] + } + } + }, + "definitions": { + "ServicesServiceChangeServiceBody": { + "type": "object", + "properties": { + "environment": { + "type": "string", + "x-nullable": true + }, + "cluster": { + "type": "string", + "x-nullable": true + }, + "replication_set": { + "type": "string", + "x-nullable": true + }, + "external_group": { + "type": "string", + "x-nullable": true + }, + "custom_labels": { + "$ref": "#/definitions/commonStringMap", + "x-nullable": true, + "description": "Replace all custom user-assigned labels." + } + } + }, + "commonStringMap": { + "type": "object", + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value." + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1AddExternalServiceParams": { + "type": "object", + "properties": { + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Required." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs. Required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "group": { + "type": "string", + "description": "Group name of external service." + } + } + }, + "v1AddHAProxyServiceParams": { + "type": "object", + "properties": { + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Required." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs. Required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + } + }, + "v1AddMongoDBServiceParams": { + "type": "object", + "properties": { + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Required." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs. Required." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + } + }, + "v1AddMySQLServiceParams": { + "type": "object", + "properties": { + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Required." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs. Required." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra parameters to be added to the DSN." + } + } + }, + "v1AddPostgreSQLServiceParams": { + "type": "object", + "properties": { + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Required." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs. Required." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "auto_discovery_limit": { + "type": "integer", + "format": "int32", + "description": "Limit of databases for auto-discovery." + } + } + }, + "v1AddProxySQLServiceParams": { + "type": "object", + "properties": { + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Required." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs. Required." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + } + }, + "v1AddServiceRequest": { + "type": "object", + "properties": { + "mysql": { + "$ref": "#/definitions/v1AddMySQLServiceParams" + }, + "mongodb": { + "$ref": "#/definitions/v1AddMongoDBServiceParams" + }, + "postgresql": { + "$ref": "#/definitions/v1AddPostgreSQLServiceParams" + }, + "proxysql": { + "$ref": "#/definitions/v1AddProxySQLServiceParams" + }, + "haproxy": { + "$ref": "#/definitions/v1AddHAProxyServiceParams" + }, + "external": { + "$ref": "#/definitions/v1AddExternalServiceParams" + }, + "valkey": { + "$ref": "#/definitions/v1AddValkeyServiceParams" + } + } + }, + "v1AddServiceResponse": { + "type": "object", + "properties": { + "mysql": { + "$ref": "#/definitions/v1MySQLService" + }, + "mongodb": { + "$ref": "#/definitions/v1MongoDBService" + }, + "postgresql": { + "$ref": "#/definitions/v1PostgreSQLService" + }, + "proxysql": { + "$ref": "#/definitions/v1ProxySQLService" + }, + "haproxy": { + "$ref": "#/definitions/v1HAProxyService" + }, + "external": { + "$ref": "#/definitions/v1ExternalService" + }, + "valkey": { + "$ref": "#/definitions/v1ValkeyService" + } + } + }, + "v1AddValkeyServiceParams": { + "type": "object", + "properties": { + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Required." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs. Required." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + } + }, + "v1ChangeServiceResponse": { + "type": "object", + "properties": { + "mysql": { + "$ref": "#/definitions/v1MySQLService" + }, + "mongodb": { + "$ref": "#/definitions/v1MongoDBService" + }, + "postgresql": { + "$ref": "#/definitions/v1PostgreSQLService" + }, + "proxysql": { + "$ref": "#/definitions/v1ProxySQLService" + }, + "haproxy": { + "$ref": "#/definitions/v1HAProxyService" + }, + "external": { + "$ref": "#/definitions/v1ExternalService" + }, + "valkey": { + "$ref": "#/definitions/v1ValkeyService" + } + } + }, + "v1ExternalService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this service instance runs." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "group": { + "type": "string", + "description": "Group name of external service." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP)." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port." + } + }, + "description": "ExternalService represents a generic External service instance." + }, + "v1GetServiceResponse": { + "type": "object", + "properties": { + "mysql": { + "$ref": "#/definitions/v1MySQLService" + }, + "mongodb": { + "$ref": "#/definitions/v1MongoDBService" + }, + "postgresql": { + "$ref": "#/definitions/v1PostgreSQLService" + }, + "proxysql": { + "$ref": "#/definitions/v1ProxySQLService" + }, + "haproxy": { + "$ref": "#/definitions/v1HAProxyService" + }, + "external": { + "$ref": "#/definitions/v1ExternalService" + }, + "valkey": { + "$ref": "#/definitions/v1ValkeyService" + } + } + }, + "v1HAProxyService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this service instance runs." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + }, + "description": "HAProxyService represents a generic HAProxy service instance." + }, + "v1ListActiveServiceTypesRequest": { + "type": "object" + }, + "v1ListActiveServiceTypesResponse": { + "type": "object", + "properties": { + "service_types": { + "type": "array", + "items": { + "$ref": "#/definitions/v1ServiceType" + } + } + } + }, + "v1ListServicesResponse": { + "type": "object", + "properties": { + "mysql": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1MySQLService" + } + }, + "mongodb": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1MongoDBService" + } + }, + "postgresql": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PostgreSQLService" + } + }, + "proxysql": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ProxySQLService" + } + }, + "haproxy": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1HAProxyService" + } + }, + "external": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ExternalService" + } + }, + "valkey": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ValkeyService" + } + } + } + }, + "v1MongoDBService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "version": { + "type": "string", + "description": "MongoDB version." + } + }, + "description": "MongoDBService represents a generic MongoDB instance." + }, + "v1MySQLService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "version": { + "type": "string", + "description": "MySQL version." + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra parameters to be added to the DSN." + } + }, + "description": "MySQLService represents a generic MySQL instance." + }, + "v1PostgreSQLService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "database_name": { + "type": "string", + "description": "Database name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "version": { + "type": "string", + "description": "PostgreSQL version." + }, + "auto_discovery_limit": { + "type": "integer", + "format": "int32", + "description": "Limit of databases for auto-discovery." + } + }, + "description": "PostgreSQLService represents a generic PostgreSQL instance." + }, + "v1ProxySQLService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "version": { + "type": "string", + "description": "ProxySQL version." + } + }, + "description": "ProxySQLService represents a generic ProxySQL instance." + }, + "v1RemoveServiceResponse": { + "type": "object" + }, + "v1ServiceType": { + "type": "string", + "enum": [ + "SERVICE_TYPE_UNSPECIFIED", + "SERVICE_TYPE_MYSQL_SERVICE", + "SERVICE_TYPE_MONGODB_SERVICE", + "SERVICE_TYPE_POSTGRESQL_SERVICE", + "SERVICE_TYPE_VALKEY_SERVICE", + "SERVICE_TYPE_PROXYSQL_SERVICE", + "SERVICE_TYPE_HAPROXY_SERVICE", + "SERVICE_TYPE_EXTERNAL_SERVICE" + ], + "default": "SERVICE_TYPE_UNSPECIFIED", + "description": "ServiceType describes supported Service types." + }, + "v1ValkeyService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "version": { + "type": "string", + "description": "Valkey version." + } + }, + "description": "ValkeyService represents a generic Valkey instance." + } + } +} diff --git a/api/inventory/v1/services_grpc.pb.go b/api/inventory/v1/services_grpc.pb.go index 1de232e4cc5..27f42369172 100644 --- a/api/inventory/v1/services_grpc.pb.go +++ b/api/inventory/v1/services_grpc.pb.go @@ -8,7 +8,6 @@ package inventoryv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -147,23 +146,18 @@ type UnimplementedServicesServiceServer struct{} func (UnimplementedServicesServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListServices not implemented") } - func (UnimplementedServicesServiceServer) ListActiveServiceTypes(context.Context, *ListActiveServiceTypesRequest) (*ListActiveServiceTypesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListActiveServiceTypes not implemented") } - func (UnimplementedServicesServiceServer) GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetService not implemented") } - func (UnimplementedServicesServiceServer) AddService(context.Context, *AddServiceRequest) (*AddServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddService not implemented") } - func (UnimplementedServicesServiceServer) RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveService not implemented") } - func (UnimplementedServicesServiceServer) ChangeService(context.Context, *ChangeServiceRequest) (*ChangeServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method ChangeService not implemented") } diff --git a/api/management/v1/agent.pb.go b/api/management/v1/agent.pb.go index 8225cca8957..7661cbe75cc 100644 --- a/api/management/v1/agent.pb.go +++ b/api/management/v1/agent.pb.go @@ -7,15 +7,13 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - + v1 "github.com/percona/pmm/api/inventory/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -1205,30 +1203,27 @@ func file_management_v1_agent_proto_rawDescGZIP() []byte { return file_management_v1_agent_proto_rawDescData } -var ( - file_management_v1_agent_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_management_v1_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 13) - file_management_v1_agent_proto_goTypes = []any{ - (UpdateSeverity)(0), // 0: management.v1.UpdateSeverity - (*UniversalAgent)(nil), // 1: management.v1.UniversalAgent - (*ListAgentsRequest)(nil), // 2: management.v1.ListAgentsRequest - (*ListAgentsResponse)(nil), // 3: management.v1.ListAgentsResponse - (*AgentVersions)(nil), // 4: management.v1.AgentVersions - (*ListAgentVersionsRequest)(nil), // 5: management.v1.ListAgentVersionsRequest - (*ListAgentVersionsResponse)(nil), // 6: management.v1.ListAgentVersionsResponse - (*UniversalAgent_MySQLOptions)(nil), // 7: management.v1.UniversalAgent.MySQLOptions - (*UniversalAgent_AzureOptions)(nil), // 8: management.v1.UniversalAgent.AzureOptions - (*UniversalAgent_MongoDBOptions)(nil), // 9: management.v1.UniversalAgent.MongoDBOptions - (*UniversalAgent_PostgreSQLOptions)(nil), // 10: management.v1.UniversalAgent.PostgreSQLOptions - (*UniversalAgent_ValkeyOptions)(nil), // 11: management.v1.UniversalAgent.ValkeyOptions - nil, // 12: management.v1.UniversalAgent.CustomLabelsEntry - nil, // 13: management.v1.UniversalAgent.MySQLOptions.ExtraDsnParamsEntry - (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp - (v1.LogLevel)(0), // 15: inventory.v1.LogLevel - (*v1.RTAOptions)(nil), // 16: inventory.v1.RTAOptions - } -) - +var file_management_v1_agent_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_management_v1_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_management_v1_agent_proto_goTypes = []any{ + (UpdateSeverity)(0), // 0: management.v1.UpdateSeverity + (*UniversalAgent)(nil), // 1: management.v1.UniversalAgent + (*ListAgentsRequest)(nil), // 2: management.v1.ListAgentsRequest + (*ListAgentsResponse)(nil), // 3: management.v1.ListAgentsResponse + (*AgentVersions)(nil), // 4: management.v1.AgentVersions + (*ListAgentVersionsRequest)(nil), // 5: management.v1.ListAgentVersionsRequest + (*ListAgentVersionsResponse)(nil), // 6: management.v1.ListAgentVersionsResponse + (*UniversalAgent_MySQLOptions)(nil), // 7: management.v1.UniversalAgent.MySQLOptions + (*UniversalAgent_AzureOptions)(nil), // 8: management.v1.UniversalAgent.AzureOptions + (*UniversalAgent_MongoDBOptions)(nil), // 9: management.v1.UniversalAgent.MongoDBOptions + (*UniversalAgent_PostgreSQLOptions)(nil), // 10: management.v1.UniversalAgent.PostgreSQLOptions + (*UniversalAgent_ValkeyOptions)(nil), // 11: management.v1.UniversalAgent.ValkeyOptions + nil, // 12: management.v1.UniversalAgent.CustomLabelsEntry + nil, // 13: management.v1.UniversalAgent.MySQLOptions.ExtraDsnParamsEntry + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp + (v1.LogLevel)(0), // 15: inventory.v1.LogLevel + (*v1.RTAOptions)(nil), // 16: inventory.v1.RTAOptions +} var file_management_v1_agent_proto_depIdxs = []int32{ 8, // 0: management.v1.UniversalAgent.azure_options:type_name -> management.v1.UniversalAgent.AzureOptions 14, // 1: management.v1.UniversalAgent.created_at:type_name -> google.protobuf.Timestamp diff --git a/api/management/v1/agent.swagger.json b/api/management/v1/agent.swagger.json new file mode 100644 index 00000000000..66ea6d4a070 --- /dev/null +++ b/api/management/v1/agent.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/agent.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/management/v1/annotation.pb.go b/api/management/v1/annotation.pb.go index ec781561e4c..d014773c308 100644 --- a/api/management/v1/annotation.pb.go +++ b/api/management/v1/annotation.pb.go @@ -7,13 +7,12 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -157,14 +156,11 @@ func file_management_v1_annotation_proto_rawDescGZIP() []byte { return file_management_v1_annotation_proto_rawDescData } -var ( - file_management_v1_annotation_proto_msgTypes = make([]protoimpl.MessageInfo, 2) - file_management_v1_annotation_proto_goTypes = []any{ - (*AddAnnotationRequest)(nil), // 0: management.v1.AddAnnotationRequest - (*AddAnnotationResponse)(nil), // 1: management.v1.AddAnnotationResponse - } -) - +var file_management_v1_annotation_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_management_v1_annotation_proto_goTypes = []any{ + (*AddAnnotationRequest)(nil), // 0: management.v1.AddAnnotationRequest + (*AddAnnotationResponse)(nil), // 1: management.v1.AddAnnotationResponse +} var file_management_v1_annotation_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/management/v1/annotation.swagger.json b/api/management/v1/annotation.swagger.json new file mode 100644 index 00000000000..3d5937159fb --- /dev/null +++ b/api/management/v1/annotation.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/annotation.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/management/v1/azure.pb.go b/api/management/v1/azure.pb.go index fdd2f154751..c523ba94e70 100644 --- a/api/management/v1/azure.pb.go +++ b/api/management/v1/azure.pb.go @@ -7,13 +7,12 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -699,20 +698,17 @@ func file_management_v1_azure_proto_rawDescGZIP() []byte { return file_management_v1_azure_proto_rawDescData } -var ( - file_management_v1_azure_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_management_v1_azure_proto_msgTypes = make([]protoimpl.MessageInfo, 6) - file_management_v1_azure_proto_goTypes = []any{ - (DiscoverAzureDatabaseType)(0), // 0: management.v1.DiscoverAzureDatabaseType - (*DiscoverAzureDatabaseRequest)(nil), // 1: management.v1.DiscoverAzureDatabaseRequest - (*DiscoverAzureDatabaseInstance)(nil), // 2: management.v1.DiscoverAzureDatabaseInstance - (*DiscoverAzureDatabaseResponse)(nil), // 3: management.v1.DiscoverAzureDatabaseResponse - (*AddAzureDatabaseRequest)(nil), // 4: management.v1.AddAzureDatabaseRequest - (*AddAzureDatabaseResponse)(nil), // 5: management.v1.AddAzureDatabaseResponse - nil, // 6: management.v1.AddAzureDatabaseRequest.CustomLabelsEntry - } -) - +var file_management_v1_azure_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_management_v1_azure_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_management_v1_azure_proto_goTypes = []any{ + (DiscoverAzureDatabaseType)(0), // 0: management.v1.DiscoverAzureDatabaseType + (*DiscoverAzureDatabaseRequest)(nil), // 1: management.v1.DiscoverAzureDatabaseRequest + (*DiscoverAzureDatabaseInstance)(nil), // 2: management.v1.DiscoverAzureDatabaseInstance + (*DiscoverAzureDatabaseResponse)(nil), // 3: management.v1.DiscoverAzureDatabaseResponse + (*AddAzureDatabaseRequest)(nil), // 4: management.v1.AddAzureDatabaseRequest + (*AddAzureDatabaseResponse)(nil), // 5: management.v1.AddAzureDatabaseResponse + nil, // 6: management.v1.AddAzureDatabaseRequest.CustomLabelsEntry +} var file_management_v1_azure_proto_depIdxs = []int32{ 0, // 0: management.v1.DiscoverAzureDatabaseInstance.type:type_name -> management.v1.DiscoverAzureDatabaseType 2, // 1: management.v1.DiscoverAzureDatabaseResponse.azure_database_instance:type_name -> management.v1.DiscoverAzureDatabaseInstance diff --git a/api/management/v1/azure.swagger.json b/api/management/v1/azure.swagger.json new file mode 100644 index 00000000000..83b5bc19d33 --- /dev/null +++ b/api/management/v1/azure.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/azure.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/management/v1/external.pb.go b/api/management/v1/external.pb.go index 1f2612371ce..4585b95173f 100644 --- a/api/management/v1/external.pb.go +++ b/api/management/v1/external.pb.go @@ -7,15 +7,13 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" + v1 "github.com/percona/pmm/api/inventory/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -342,19 +340,16 @@ func file_management_v1_external_proto_rawDescGZIP() []byte { return file_management_v1_external_proto_rawDescData } -var ( - file_management_v1_external_proto_msgTypes = make([]protoimpl.MessageInfo, 3) - file_management_v1_external_proto_goTypes = []any{ - (*AddExternalServiceParams)(nil), // 0: management.v1.AddExternalServiceParams - (*ExternalServiceResult)(nil), // 1: management.v1.ExternalServiceResult - nil, // 2: management.v1.AddExternalServiceParams.CustomLabelsEntry - (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams - (MetricsMode)(0), // 4: management.v1.MetricsMode - (*v1.ExternalService)(nil), // 5: inventory.v1.ExternalService - (*v1.ExternalExporter)(nil), // 6: inventory.v1.ExternalExporter - } -) - +var file_management_v1_external_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_management_v1_external_proto_goTypes = []any{ + (*AddExternalServiceParams)(nil), // 0: management.v1.AddExternalServiceParams + (*ExternalServiceResult)(nil), // 1: management.v1.ExternalServiceResult + nil, // 2: management.v1.AddExternalServiceParams.CustomLabelsEntry + (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams + (MetricsMode)(0), // 4: management.v1.MetricsMode + (*v1.ExternalService)(nil), // 5: inventory.v1.ExternalService + (*v1.ExternalExporter)(nil), // 6: inventory.v1.ExternalExporter +} var file_management_v1_external_proto_depIdxs = []int32{ 3, // 0: management.v1.AddExternalServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddExternalServiceParams.custom_labels:type_name -> management.v1.AddExternalServiceParams.CustomLabelsEntry diff --git a/api/management/v1/external.swagger.json b/api/management/v1/external.swagger.json new file mode 100644 index 00000000000..ee98890ec3a --- /dev/null +++ b/api/management/v1/external.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/external.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/management/v1/haproxy.pb.go b/api/management/v1/haproxy.pb.go index 06b4c664762..662b9422e42 100644 --- a/api/management/v1/haproxy.pb.go +++ b/api/management/v1/haproxy.pb.go @@ -7,15 +7,13 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" + v1 "github.com/percona/pmm/api/inventory/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -320,19 +318,16 @@ func file_management_v1_haproxy_proto_rawDescGZIP() []byte { return file_management_v1_haproxy_proto_rawDescData } -var ( - file_management_v1_haproxy_proto_msgTypes = make([]protoimpl.MessageInfo, 3) - file_management_v1_haproxy_proto_goTypes = []any{ - (*AddHAProxyServiceParams)(nil), // 0: management.v1.AddHAProxyServiceParams - (*HAProxyServiceResult)(nil), // 1: management.v1.HAProxyServiceResult - nil, // 2: management.v1.AddHAProxyServiceParams.CustomLabelsEntry - (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams - (MetricsMode)(0), // 4: management.v1.MetricsMode - (*v1.HAProxyService)(nil), // 5: inventory.v1.HAProxyService - (*v1.ExternalExporter)(nil), // 6: inventory.v1.ExternalExporter - } -) - +var file_management_v1_haproxy_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_management_v1_haproxy_proto_goTypes = []any{ + (*AddHAProxyServiceParams)(nil), // 0: management.v1.AddHAProxyServiceParams + (*HAProxyServiceResult)(nil), // 1: management.v1.HAProxyServiceResult + nil, // 2: management.v1.AddHAProxyServiceParams.CustomLabelsEntry + (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams + (MetricsMode)(0), // 4: management.v1.MetricsMode + (*v1.HAProxyService)(nil), // 5: inventory.v1.HAProxyService + (*v1.ExternalExporter)(nil), // 6: inventory.v1.ExternalExporter +} var file_management_v1_haproxy_proto_depIdxs = []int32{ 3, // 0: management.v1.AddHAProxyServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddHAProxyServiceParams.custom_labels:type_name -> management.v1.AddHAProxyServiceParams.CustomLabelsEntry diff --git a/api/management/v1/haproxy.swagger.json b/api/management/v1/haproxy.swagger.json new file mode 100644 index 00000000000..456d36f1f16 --- /dev/null +++ b/api/management/v1/haproxy.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/haproxy.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/management/v1/json/client/management_service/add_annotation_parameters.go b/api/management/v1/json/client/management_service/add_annotation_parameters.go index 0a6148e59af..68d4bd76539 100644 --- a/api/management/v1/json/client/management_service/add_annotation_parameters.go +++ b/api/management/v1/json/client/management_service/add_annotation_parameters.go @@ -60,6 +60,7 @@ AddAnnotationParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type AddAnnotationParams struct { + /* Body. AddAnnotationRequest is a params to add new annotation. @@ -132,6 +133,7 @@ func (o *AddAnnotationParams) SetBody(body AddAnnotationBody) { // WriteToRequest writes these params to a swagger request func (o *AddAnnotationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/add_annotation_responses.go b/api/management/v1/json/client/management_service/add_annotation_responses.go index e0707e893c8..ad0abf531dc 100644 --- a/api/management/v1/json/client/management_service/add_annotation_responses.go +++ b/api/management/v1/json/client/management_service/add_annotation_responses.go @@ -8,7 +8,6 @@ package management_service import ( "context" "encoding/json" - stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +24,7 @@ type AddAnnotationReader struct { } // ReadResponse reads a server response into the received o. -func (o *AddAnnotationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { +func (o *AddAnnotationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewAddAnnotationOK() @@ -56,7 +55,7 @@ AddAnnotationOK describes a response with status code 200, with default header v A successful response. */ type AddAnnotationOK struct { - Payload any + Payload interface{} } // IsSuccess returns true when this add annotation Ok response has a 2xx status code @@ -99,13 +98,14 @@ func (o *AddAnnotationOK) String() string { return fmt.Sprintf("[POST /v1/management/annotations][%d] addAnnotationOk %s", 200, payload) } -func (o *AddAnnotationOK) GetPayload() any { +func (o *AddAnnotationOK) GetPayload() interface{} { return o.Payload } func (o *AddAnnotationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } @@ -175,10 +175,11 @@ func (o *AddAnnotationDefault) GetPayload() *AddAnnotationDefaultBody { } func (o *AddAnnotationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(AddAnnotationDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -190,6 +191,7 @@ AddAnnotationBody AddAnnotationRequest is a params to add new annotation. swagger:model AddAnnotationBody */ type AddAnnotationBody struct { + // An annotation description. Required. Text string `json:"text,omitempty"` @@ -236,6 +238,7 @@ AddAnnotationDefaultBody add annotation default body swagger:model AddAnnotationDefaultBody */ type AddAnnotationDefaultBody struct { + // code Code int32 `json:"code,omitempty"` @@ -272,15 +275,11 @@ func (o *AddAnnotationDefaultBody) validateDetails(formats strfmt.Registry) erro if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } @@ -305,7 +304,9 @@ func (o *AddAnnotationDefaultBody) ContextValidate(ctx context.Context, formats } func (o *AddAnnotationDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -313,18 +314,15 @@ func (o *AddAnnotationDefaultBody) contextValidateDetails(ctx context.Context, f } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -353,17 +351,19 @@ AddAnnotationDefaultBodyDetailsItems0 add annotation default body details items0 swagger:model AddAnnotationDefaultBodyDetailsItems0 */ type AddAnnotationDefaultBodyDetailsItems0 struct { + // at type AtType string `json:"@type,omitempty"` // add annotation default body details items0 - AddAnnotationDefaultBodyDetailsItems0 map[string]any `json:"-"` + AddAnnotationDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *AddAnnotationDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -384,9 +384,9 @@ func (o *AddAnnotationDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]any) + result := make(map[string]interface{}) for k, v := range stage2 { - var toadd any + var toadd interface{} if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -401,6 +401,7 @@ func (o *AddAnnotationDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error // MarshalJSON marshals this object with additional properties into a JSON object func (o AddAnnotationDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } diff --git a/api/management/v1/json/client/management_service/add_azure_database_parameters.go b/api/management/v1/json/client/management_service/add_azure_database_parameters.go index b9e1d96ff02..1fd8c87b5db 100644 --- a/api/management/v1/json/client/management_service/add_azure_database_parameters.go +++ b/api/management/v1/json/client/management_service/add_azure_database_parameters.go @@ -60,6 +60,7 @@ AddAzureDatabaseParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type AddAzureDatabaseParams struct { + // Body. Body AddAzureDatabaseBody @@ -129,6 +130,7 @@ func (o *AddAzureDatabaseParams) SetBody(body AddAzureDatabaseBody) { // WriteToRequest writes these params to a swagger request func (o *AddAzureDatabaseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/add_azure_database_responses.go b/api/management/v1/json/client/management_service/add_azure_database_responses.go index 947f66d7e84..4f846697436 100644 --- a/api/management/v1/json/client/management_service/add_azure_database_responses.go +++ b/api/management/v1/json/client/management_service/add_azure_database_responses.go @@ -8,7 +8,6 @@ package management_service import ( "context" "encoding/json" - stderrors "errors" "fmt" "io" "strconv" @@ -26,7 +25,7 @@ type AddAzureDatabaseReader struct { } // ReadResponse reads a server response into the received o. -func (o *AddAzureDatabaseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { +func (o *AddAzureDatabaseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewAddAzureDatabaseOK() @@ -57,7 +56,7 @@ AddAzureDatabaseOK describes a response with status code 200, with default heade A successful response. */ type AddAzureDatabaseOK struct { - Payload any + Payload interface{} } // IsSuccess returns true when this add azure database Ok response has a 2xx status code @@ -100,13 +99,14 @@ func (o *AddAzureDatabaseOK) String() string { return fmt.Sprintf("[POST /v1/management/services/azure][%d] addAzureDatabaseOk %s", 200, payload) } -func (o *AddAzureDatabaseOK) GetPayload() any { +func (o *AddAzureDatabaseOK) GetPayload() interface{} { return o.Payload } func (o *AddAzureDatabaseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } @@ -176,10 +176,11 @@ func (o *AddAzureDatabaseDefault) GetPayload() *AddAzureDatabaseDefaultBody { } func (o *AddAzureDatabaseDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(AddAzureDatabaseDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -191,6 +192,7 @@ AddAzureDatabaseBody add azure database body swagger:model AddAzureDatabaseBody */ type AddAzureDatabaseBody struct { + // Azure database location. Region string `json:"region,omitempty"` @@ -288,7 +290,7 @@ func (o *AddAzureDatabaseBody) Validate(formats strfmt.Registry) error { return nil } -var addAzureDatabaseBodyTypeTypePropEnum []any +var addAzureDatabaseBodyTypeTypePropEnum []interface{} func init() { var res []string @@ -361,6 +363,7 @@ AddAzureDatabaseDefaultBody add azure database default body swagger:model AddAzureDatabaseDefaultBody */ type AddAzureDatabaseDefaultBody struct { + // code Code int32 `json:"code,omitempty"` @@ -397,15 +400,11 @@ func (o *AddAzureDatabaseDefaultBody) validateDetails(formats strfmt.Registry) e if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } @@ -430,7 +429,9 @@ func (o *AddAzureDatabaseDefaultBody) ContextValidate(ctx context.Context, forma } func (o *AddAzureDatabaseDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -438,18 +439,15 @@ func (o *AddAzureDatabaseDefaultBody) contextValidateDetails(ctx context.Context } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -478,17 +476,19 @@ AddAzureDatabaseDefaultBodyDetailsItems0 add azure database default body details swagger:model AddAzureDatabaseDefaultBodyDetailsItems0 */ type AddAzureDatabaseDefaultBodyDetailsItems0 struct { + // at type AtType string `json:"@type,omitempty"` // add azure database default body details items0 - AddAzureDatabaseDefaultBodyDetailsItems0 map[string]any `json:"-"` + AddAzureDatabaseDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *AddAzureDatabaseDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -509,9 +509,9 @@ func (o *AddAzureDatabaseDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) er delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]any) + result := make(map[string]interface{}) for k, v := range stage2 { - var toadd any + var toadd interface{} if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -526,6 +526,7 @@ func (o *AddAzureDatabaseDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) er // MarshalJSON marshals this object with additional properties into a JSON object func (o AddAzureDatabaseDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } diff --git a/api/management/v1/json/client/management_service/add_service_parameters.go b/api/management/v1/json/client/management_service/add_service_parameters.go index 64e2dd78b6b..8e80c2a6085 100644 --- a/api/management/v1/json/client/management_service/add_service_parameters.go +++ b/api/management/v1/json/client/management_service/add_service_parameters.go @@ -60,6 +60,7 @@ AddServiceParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type AddServiceParams struct { + // Body. Body AddServiceBody @@ -129,6 +130,7 @@ func (o *AddServiceParams) SetBody(body AddServiceBody) { // WriteToRequest writes these params to a swagger request func (o *AddServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/add_service_responses.go b/api/management/v1/json/client/management_service/add_service_responses.go index 40d004ff770..64f90464ae3 100644 --- a/api/management/v1/json/client/management_service/add_service_responses.go +++ b/api/management/v1/json/client/management_service/add_service_responses.go @@ -8,7 +8,6 @@ package management_service import ( "context" "encoding/json" - stderrors "errors" "fmt" "io" "strconv" @@ -26,7 +25,7 @@ type AddServiceReader struct { } // ReadResponse reads a server response into the received o. -func (o *AddServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { +func (o *AddServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewAddServiceOK() @@ -105,10 +104,11 @@ func (o *AddServiceOK) GetPayload() *AddServiceOKBody { } func (o *AddServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(AddServiceOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -178,10 +178,11 @@ func (o *AddServiceDefault) GetPayload() *AddServiceDefaultBody { } func (o *AddServiceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(AddServiceDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -193,6 +194,7 @@ AddServiceBody add service body swagger:model AddServiceBody */ type AddServiceBody struct { + // external External *AddServiceParamsBodyExternal `json:"external,omitempty"` @@ -267,15 +269,11 @@ func (o *AddServiceBody) validateExternal(formats strfmt.Registry) error { if o.External != nil { if err := o.External.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "external") } - return err } } @@ -290,15 +288,11 @@ func (o *AddServiceBody) validateHaproxy(formats strfmt.Registry) error { if o.Haproxy != nil { if err := o.Haproxy.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "haproxy") } - return err } } @@ -313,15 +307,11 @@ func (o *AddServiceBody) validateMongodb(formats strfmt.Registry) error { if o.Mongodb != nil { if err := o.Mongodb.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "mongodb") } - return err } } @@ -336,15 +326,11 @@ func (o *AddServiceBody) validateMysql(formats strfmt.Registry) error { if o.Mysql != nil { if err := o.Mysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "mysql") } - return err } } @@ -359,15 +345,11 @@ func (o *AddServiceBody) validatePostgresql(formats strfmt.Registry) error { if o.Postgresql != nil { if err := o.Postgresql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "postgresql") } - return err } } @@ -382,15 +364,11 @@ func (o *AddServiceBody) validateProxysql(formats strfmt.Registry) error { if o.Proxysql != nil { if err := o.Proxysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "proxysql") } - return err } } @@ -405,15 +383,11 @@ func (o *AddServiceBody) validateRDS(formats strfmt.Registry) error { if o.RDS != nil { if err := o.RDS.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "rds") } - return err } } @@ -428,15 +402,11 @@ func (o *AddServiceBody) validateValkey(formats strfmt.Registry) error { if o.Valkey != nil { if err := o.Valkey.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "valkey") } - return err } } @@ -487,6 +457,7 @@ func (o *AddServiceBody) ContextValidate(ctx context.Context, formats strfmt.Reg } func (o *AddServiceBody) contextValidateExternal(ctx context.Context, formats strfmt.Registry) error { + if o.External != nil { if swag.IsZero(o.External) { // not required @@ -494,15 +465,11 @@ func (o *AddServiceBody) contextValidateExternal(ctx context.Context, formats st } if err := o.External.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "external") } - return err } } @@ -511,6 +478,7 @@ func (o *AddServiceBody) contextValidateExternal(ctx context.Context, formats st } func (o *AddServiceBody) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { + if o.Haproxy != nil { if swag.IsZero(o.Haproxy) { // not required @@ -518,15 +486,11 @@ func (o *AddServiceBody) contextValidateHaproxy(ctx context.Context, formats str } if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "haproxy") } - return err } } @@ -535,6 +499,7 @@ func (o *AddServiceBody) contextValidateHaproxy(ctx context.Context, formats str } func (o *AddServiceBody) contextValidateMongodb(ctx context.Context, formats strfmt.Registry) error { + if o.Mongodb != nil { if swag.IsZero(o.Mongodb) { // not required @@ -542,15 +507,11 @@ func (o *AddServiceBody) contextValidateMongodb(ctx context.Context, formats str } if err := o.Mongodb.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "mongodb") } - return err } } @@ -559,6 +520,7 @@ func (o *AddServiceBody) contextValidateMongodb(ctx context.Context, formats str } func (o *AddServiceBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { + if o.Mysql != nil { if swag.IsZero(o.Mysql) { // not required @@ -566,15 +528,11 @@ func (o *AddServiceBody) contextValidateMysql(ctx context.Context, formats strfm } if err := o.Mysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "mysql") } - return err } } @@ -583,6 +541,7 @@ func (o *AddServiceBody) contextValidateMysql(ctx context.Context, formats strfm } func (o *AddServiceBody) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { + if o.Postgresql != nil { if swag.IsZero(o.Postgresql) { // not required @@ -590,15 +549,11 @@ func (o *AddServiceBody) contextValidatePostgresql(ctx context.Context, formats } if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "postgresql") } - return err } } @@ -607,6 +562,7 @@ func (o *AddServiceBody) contextValidatePostgresql(ctx context.Context, formats } func (o *AddServiceBody) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { + if o.Proxysql != nil { if swag.IsZero(o.Proxysql) { // not required @@ -614,15 +570,11 @@ func (o *AddServiceBody) contextValidateProxysql(ctx context.Context, formats st } if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "proxysql") } - return err } } @@ -631,6 +583,7 @@ func (o *AddServiceBody) contextValidateProxysql(ctx context.Context, formats st } func (o *AddServiceBody) contextValidateRDS(ctx context.Context, formats strfmt.Registry) error { + if o.RDS != nil { if swag.IsZero(o.RDS) { // not required @@ -638,15 +591,11 @@ func (o *AddServiceBody) contextValidateRDS(ctx context.Context, formats strfmt. } if err := o.RDS.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "rds") } - return err } } @@ -655,6 +604,7 @@ func (o *AddServiceBody) contextValidateRDS(ctx context.Context, formats strfmt. } func (o *AddServiceBody) contextValidateValkey(ctx context.Context, formats strfmt.Registry) error { + if o.Valkey != nil { if swag.IsZero(o.Valkey) { // not required @@ -662,15 +612,11 @@ func (o *AddServiceBody) contextValidateValkey(ctx context.Context, formats strf } if err := o.Valkey.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "valkey") } - return err } } @@ -701,6 +647,7 @@ AddServiceDefaultBody add service default body swagger:model AddServiceDefaultBody */ type AddServiceDefaultBody struct { + // code Code int32 `json:"code,omitempty"` @@ -737,15 +684,11 @@ func (o *AddServiceDefaultBody) validateDetails(formats strfmt.Registry) error { if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } @@ -770,7 +713,9 @@ func (o *AddServiceDefaultBody) ContextValidate(ctx context.Context, formats str } func (o *AddServiceDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -778,18 +723,15 @@ func (o *AddServiceDefaultBody) contextValidateDetails(ctx context.Context, form } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -818,17 +760,19 @@ AddServiceDefaultBodyDetailsItems0 add service default body details items0 swagger:model AddServiceDefaultBodyDetailsItems0 */ type AddServiceDefaultBodyDetailsItems0 struct { + // at type AtType string `json:"@type,omitempty"` // add service default body details items0 - AddServiceDefaultBodyDetailsItems0 map[string]any `json:"-"` + AddServiceDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *AddServiceDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -849,9 +793,9 @@ func (o *AddServiceDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]any) + result := make(map[string]interface{}) for k, v := range stage2 { - var toadd any + var toadd interface{} if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -866,6 +810,7 @@ func (o *AddServiceDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // MarshalJSON marshals this object with additional properties into a JSON object func (o AddServiceDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -929,6 +874,7 @@ AddServiceOKBody add service OK body swagger:model AddServiceOKBody */ type AddServiceOKBody struct { + // external External *AddServiceOKBodyExternal `json:"external,omitempty"` @@ -1003,15 +949,11 @@ func (o *AddServiceOKBody) validateExternal(formats strfmt.Registry) error { if o.External != nil { if err := o.External.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "external") } - return err } } @@ -1026,15 +968,11 @@ func (o *AddServiceOKBody) validateHaproxy(formats strfmt.Registry) error { if o.Haproxy != nil { if err := o.Haproxy.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "haproxy") } - return err } } @@ -1049,15 +987,11 @@ func (o *AddServiceOKBody) validateMongodb(formats strfmt.Registry) error { if o.Mongodb != nil { if err := o.Mongodb.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb") } - return err } } @@ -1072,15 +1006,11 @@ func (o *AddServiceOKBody) validateMysql(formats strfmt.Registry) error { if o.Mysql != nil { if err := o.Mysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mysql") } - return err } } @@ -1095,15 +1025,11 @@ func (o *AddServiceOKBody) validatePostgresql(formats strfmt.Registry) error { if o.Postgresql != nil { if err := o.Postgresql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "postgresql") } - return err } } @@ -1118,15 +1044,11 @@ func (o *AddServiceOKBody) validateProxysql(formats strfmt.Registry) error { if o.Proxysql != nil { if err := o.Proxysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "proxysql") } - return err } } @@ -1141,15 +1063,11 @@ func (o *AddServiceOKBody) validateRDS(formats strfmt.Registry) error { if o.RDS != nil { if err := o.RDS.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds") } - return err } } @@ -1164,15 +1082,11 @@ func (o *AddServiceOKBody) validateValkey(formats strfmt.Registry) error { if o.Valkey != nil { if err := o.Valkey.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "valkey") } - return err } } @@ -1223,6 +1137,7 @@ func (o *AddServiceOKBody) ContextValidate(ctx context.Context, formats strfmt.R } func (o *AddServiceOKBody) contextValidateExternal(ctx context.Context, formats strfmt.Registry) error { + if o.External != nil { if swag.IsZero(o.External) { // not required @@ -1230,15 +1145,11 @@ func (o *AddServiceOKBody) contextValidateExternal(ctx context.Context, formats } if err := o.External.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "external") } - return err } } @@ -1247,6 +1158,7 @@ func (o *AddServiceOKBody) contextValidateExternal(ctx context.Context, formats } func (o *AddServiceOKBody) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { + if o.Haproxy != nil { if swag.IsZero(o.Haproxy) { // not required @@ -1254,15 +1166,11 @@ func (o *AddServiceOKBody) contextValidateHaproxy(ctx context.Context, formats s } if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "haproxy") } - return err } } @@ -1271,6 +1179,7 @@ func (o *AddServiceOKBody) contextValidateHaproxy(ctx context.Context, formats s } func (o *AddServiceOKBody) contextValidateMongodb(ctx context.Context, formats strfmt.Registry) error { + if o.Mongodb != nil { if swag.IsZero(o.Mongodb) { // not required @@ -1278,15 +1187,11 @@ func (o *AddServiceOKBody) contextValidateMongodb(ctx context.Context, formats s } if err := o.Mongodb.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb") } - return err } } @@ -1295,6 +1200,7 @@ func (o *AddServiceOKBody) contextValidateMongodb(ctx context.Context, formats s } func (o *AddServiceOKBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { + if o.Mysql != nil { if swag.IsZero(o.Mysql) { // not required @@ -1302,15 +1208,11 @@ func (o *AddServiceOKBody) contextValidateMysql(ctx context.Context, formats str } if err := o.Mysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mysql") } - return err } } @@ -1319,6 +1221,7 @@ func (o *AddServiceOKBody) contextValidateMysql(ctx context.Context, formats str } func (o *AddServiceOKBody) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { + if o.Postgresql != nil { if swag.IsZero(o.Postgresql) { // not required @@ -1326,15 +1229,11 @@ func (o *AddServiceOKBody) contextValidatePostgresql(ctx context.Context, format } if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "postgresql") } - return err } } @@ -1343,6 +1242,7 @@ func (o *AddServiceOKBody) contextValidatePostgresql(ctx context.Context, format } func (o *AddServiceOKBody) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { + if o.Proxysql != nil { if swag.IsZero(o.Proxysql) { // not required @@ -1350,15 +1250,11 @@ func (o *AddServiceOKBody) contextValidateProxysql(ctx context.Context, formats } if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "proxysql") } - return err } } @@ -1367,6 +1263,7 @@ func (o *AddServiceOKBody) contextValidateProxysql(ctx context.Context, formats } func (o *AddServiceOKBody) contextValidateRDS(ctx context.Context, formats strfmt.Registry) error { + if o.RDS != nil { if swag.IsZero(o.RDS) { // not required @@ -1374,15 +1271,11 @@ func (o *AddServiceOKBody) contextValidateRDS(ctx context.Context, formats strfm } if err := o.RDS.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds") } - return err } } @@ -1391,6 +1284,7 @@ func (o *AddServiceOKBody) contextValidateRDS(ctx context.Context, formats strfm } func (o *AddServiceOKBody) contextValidateValkey(ctx context.Context, formats strfmt.Registry) error { + if o.Valkey != nil { if swag.IsZero(o.Valkey) { // not required @@ -1398,15 +1292,11 @@ func (o *AddServiceOKBody) contextValidateValkey(ctx context.Context, formats st } if err := o.Valkey.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "valkey") } - return err } } @@ -1437,6 +1327,7 @@ AddServiceOKBodyExternal add service OK body external swagger:model AddServiceOKBodyExternal */ type AddServiceOKBodyExternal struct { + // external exporter ExternalExporter *AddServiceOKBodyExternalExternalExporter `json:"external_exporter,omitempty"` @@ -1469,15 +1360,11 @@ func (o *AddServiceOKBodyExternal) validateExternalExporter(formats strfmt.Regis if o.ExternalExporter != nil { if err := o.ExternalExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter") } - return err } } @@ -1492,15 +1379,11 @@ func (o *AddServiceOKBodyExternal) validateService(formats strfmt.Registry) erro if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "external" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "external" + "." + "service") } - return err } } @@ -1527,6 +1410,7 @@ func (o *AddServiceOKBodyExternal) ContextValidate(ctx context.Context, formats } func (o *AddServiceOKBodyExternal) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { + if o.ExternalExporter != nil { if swag.IsZero(o.ExternalExporter) { // not required @@ -1534,15 +1418,11 @@ func (o *AddServiceOKBodyExternal) contextValidateExternalExporter(ctx context.C } if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter") } - return err } } @@ -1551,6 +1431,7 @@ func (o *AddServiceOKBodyExternal) contextValidateExternalExporter(ctx context.C } func (o *AddServiceOKBodyExternal) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -1558,15 +1439,11 @@ func (o *AddServiceOKBodyExternal) contextValidateService(ctx context.Context, f } if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "external" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "external" + "." + "service") } - return err } } @@ -1597,6 +1474,7 @@ AddServiceOKBodyExternalExternalExporter ExternalExporter runs on any Node type, swagger:model AddServiceOKBodyExternalExternalExporter */ type AddServiceOKBodyExternalExternalExporter struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -1633,6 +1511,9 @@ type AddServiceOKBodyExternalExternalExporter struct { // Skip TLS certificate and hostname verification. TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` + // metrics resolutions + MetricsResolutions *AddServiceOKBodyExternalExternalExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` + // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -1644,20 +1525,17 @@ type AddServiceOKBodyExternalExternalExporter struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` - - // metrics resolutions - MetricsResolutions *AddServiceOKBodyExternalExternalExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` } // Validate validates this add service OK body external external exporter func (o *AddServiceOKBodyExternalExternalExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -1667,7 +1545,26 @@ func (o *AddServiceOKBodyExternalExternalExporter) Validate(formats strfmt.Regis return nil } -var addServiceOkBodyExternalExternalExporterTypeStatusPropEnum []any +func (o *AddServiceOKBodyExternalExternalExporter) validateMetricsResolutions(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsResolutions) { // not required + return nil + } + + if o.MetricsResolutions != nil { + if err := o.MetricsResolutions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter" + "." + "metrics_resolutions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter" + "." + "metrics_resolutions") + } + return err + } + } + + return nil +} + +var addServiceOkBodyExternalExternalExporterTypeStatusPropEnum []interface{} func init() { var res []string @@ -1727,29 +1624,6 @@ func (o *AddServiceOKBodyExternalExternalExporter) validateStatus(formats strfmt return nil } -func (o *AddServiceOKBodyExternalExternalExporter) validateMetricsResolutions(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsResolutions) { // not required - return nil - } - - if o.MetricsResolutions != nil { - if err := o.MetricsResolutions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - // ContextValidate validate this add service OK body external external exporter based on the context it is used func (o *AddServiceOKBodyExternalExternalExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -1765,6 +1639,7 @@ func (o *AddServiceOKBodyExternalExternalExporter) ContextValidate(ctx context.C } func (o *AddServiceOKBodyExternalExternalExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { + if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -1772,15 +1647,11 @@ func (o *AddServiceOKBodyExternalExternalExporter) contextValidateMetricsResolut } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter" + "." + "metrics_resolutions") } - return err } } @@ -1811,6 +1682,7 @@ AddServiceOKBodyExternalExternalExporterMetricsResolutions MetricsResolutions re swagger:model AddServiceOKBodyExternalExternalExporterMetricsResolutions */ type AddServiceOKBodyExternalExternalExporterMetricsResolutions struct { + // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -1854,6 +1726,7 @@ AddServiceOKBodyExternalService ExternalService represents a generic External se swagger:model AddServiceOKBodyExternalService */ type AddServiceOKBodyExternalService struct { + // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -1918,6 +1791,7 @@ AddServiceOKBodyHaproxy add service OK body haproxy swagger:model AddServiceOKBodyHaproxy */ type AddServiceOKBodyHaproxy struct { + // external exporter ExternalExporter *AddServiceOKBodyHaproxyExternalExporter `json:"external_exporter,omitempty"` @@ -1950,15 +1824,11 @@ func (o *AddServiceOKBodyHaproxy) validateExternalExporter(formats strfmt.Regist if o.ExternalExporter != nil { if err := o.ExternalExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter") } - return err } } @@ -1973,15 +1843,11 @@ func (o *AddServiceOKBodyHaproxy) validateService(formats strfmt.Registry) error if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "service") } - return err } } @@ -2008,6 +1874,7 @@ func (o *AddServiceOKBodyHaproxy) ContextValidate(ctx context.Context, formats s } func (o *AddServiceOKBodyHaproxy) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { + if o.ExternalExporter != nil { if swag.IsZero(o.ExternalExporter) { // not required @@ -2015,15 +1882,11 @@ func (o *AddServiceOKBodyHaproxy) contextValidateExternalExporter(ctx context.Co } if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter") } - return err } } @@ -2032,6 +1895,7 @@ func (o *AddServiceOKBodyHaproxy) contextValidateExternalExporter(ctx context.Co } func (o *AddServiceOKBodyHaproxy) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -2039,15 +1903,11 @@ func (o *AddServiceOKBodyHaproxy) contextValidateService(ctx context.Context, fo } if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "service") } - return err } } @@ -2078,6 +1938,7 @@ AddServiceOKBodyHaproxyExternalExporter ExternalExporter runs on any Node type, swagger:model AddServiceOKBodyHaproxyExternalExporter */ type AddServiceOKBodyHaproxyExternalExporter struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -2114,6 +1975,9 @@ type AddServiceOKBodyHaproxyExternalExporter struct { // Skip TLS certificate and hostname verification. TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` + // metrics resolutions + MetricsResolutions *AddServiceOKBodyHaproxyExternalExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` + // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -2125,20 +1989,17 @@ type AddServiceOKBodyHaproxyExternalExporter struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` - - // metrics resolutions - MetricsResolutions *AddServiceOKBodyHaproxyExternalExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` } // Validate validates this add service OK body haproxy external exporter func (o *AddServiceOKBodyHaproxyExternalExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -2148,7 +2009,26 @@ func (o *AddServiceOKBodyHaproxyExternalExporter) Validate(formats strfmt.Regist return nil } -var addServiceOkBodyHaproxyExternalExporterTypeStatusPropEnum []any +func (o *AddServiceOKBodyHaproxyExternalExporter) validateMetricsResolutions(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsResolutions) { // not required + return nil + } + + if o.MetricsResolutions != nil { + if err := o.MetricsResolutions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter" + "." + "metrics_resolutions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter" + "." + "metrics_resolutions") + } + return err + } + } + + return nil +} + +var addServiceOkBodyHaproxyExternalExporterTypeStatusPropEnum []interface{} func init() { var res []string @@ -2208,29 +2088,6 @@ func (o *AddServiceOKBodyHaproxyExternalExporter) validateStatus(formats strfmt. return nil } -func (o *AddServiceOKBodyHaproxyExternalExporter) validateMetricsResolutions(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsResolutions) { // not required - return nil - } - - if o.MetricsResolutions != nil { - if err := o.MetricsResolutions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - // ContextValidate validate this add service OK body haproxy external exporter based on the context it is used func (o *AddServiceOKBodyHaproxyExternalExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -2246,6 +2103,7 @@ func (o *AddServiceOKBodyHaproxyExternalExporter) ContextValidate(ctx context.Co } func (o *AddServiceOKBodyHaproxyExternalExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { + if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -2253,15 +2111,11 @@ func (o *AddServiceOKBodyHaproxyExternalExporter) contextValidateMetricsResoluti } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter" + "." + "metrics_resolutions") } - return err } } @@ -2292,6 +2146,7 @@ AddServiceOKBodyHaproxyExternalExporterMetricsResolutions MetricsResolutions rep swagger:model AddServiceOKBodyHaproxyExternalExporterMetricsResolutions */ type AddServiceOKBodyHaproxyExternalExporterMetricsResolutions struct { + // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -2335,6 +2190,7 @@ AddServiceOKBodyHaproxyService HAProxyService represents a generic HAProxy servi swagger:model AddServiceOKBodyHaproxyService */ type AddServiceOKBodyHaproxyService struct { + // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -2390,6 +2246,7 @@ AddServiceOKBodyMongodb add service OK body mongodb swagger:model AddServiceOKBodyMongodb */ type AddServiceOKBodyMongodb struct { + // mongodb exporter MongodbExporter *AddServiceOKBodyMongodbMongodbExporter `json:"mongodb_exporter,omitempty"` @@ -2443,15 +2300,11 @@ func (o *AddServiceOKBodyMongodb) validateMongodbExporter(formats strfmt.Registr if o.MongodbExporter != nil { if err := o.MongodbExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter") } - return err } } @@ -2466,15 +2319,11 @@ func (o *AddServiceOKBodyMongodb) validateQANMongodbMongolog(formats strfmt.Regi if o.QANMongodbMongolog != nil { if err := o.QANMongodbMongolog.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_mongolog") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_mongolog") } - return err } } @@ -2489,15 +2338,11 @@ func (o *AddServiceOKBodyMongodb) validateQANMongodbProfiler(formats strfmt.Regi if o.QANMongodbProfiler != nil { if err := o.QANMongodbProfiler.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_profiler") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_profiler") } - return err } } @@ -2512,15 +2357,11 @@ func (o *AddServiceOKBodyMongodb) validateRtaMongodbAgent(formats strfmt.Registr if o.RtaMongodbAgent != nil { if err := o.RtaMongodbAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent") } - return err } } @@ -2535,15 +2376,11 @@ func (o *AddServiceOKBodyMongodb) validateService(formats strfmt.Registry) error if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "service") } - return err } } @@ -2582,6 +2419,7 @@ func (o *AddServiceOKBodyMongodb) ContextValidate(ctx context.Context, formats s } func (o *AddServiceOKBodyMongodb) contextValidateMongodbExporter(ctx context.Context, formats strfmt.Registry) error { + if o.MongodbExporter != nil { if swag.IsZero(o.MongodbExporter) { // not required @@ -2589,15 +2427,11 @@ func (o *AddServiceOKBodyMongodb) contextValidateMongodbExporter(ctx context.Con } if err := o.MongodbExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter") } - return err } } @@ -2606,6 +2440,7 @@ func (o *AddServiceOKBodyMongodb) contextValidateMongodbExporter(ctx context.Con } func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbMongolog(ctx context.Context, formats strfmt.Registry) error { + if o.QANMongodbMongolog != nil { if swag.IsZero(o.QANMongodbMongolog) { // not required @@ -2613,15 +2448,11 @@ func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbMongolog(ctx context. } if err := o.QANMongodbMongolog.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_mongolog") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_mongolog") } - return err } } @@ -2630,6 +2461,7 @@ func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbMongolog(ctx context. } func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbProfiler(ctx context.Context, formats strfmt.Registry) error { + if o.QANMongodbProfiler != nil { if swag.IsZero(o.QANMongodbProfiler) { // not required @@ -2637,15 +2469,11 @@ func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbProfiler(ctx context. } if err := o.QANMongodbProfiler.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_profiler") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_profiler") } - return err } } @@ -2654,6 +2482,7 @@ func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbProfiler(ctx context. } func (o *AddServiceOKBodyMongodb) contextValidateRtaMongodbAgent(ctx context.Context, formats strfmt.Registry) error { + if o.RtaMongodbAgent != nil { if swag.IsZero(o.RtaMongodbAgent) { // not required @@ -2661,15 +2490,11 @@ func (o *AddServiceOKBodyMongodb) contextValidateRtaMongodbAgent(ctx context.Con } if err := o.RtaMongodbAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent") } - return err } } @@ -2678,6 +2503,7 @@ func (o *AddServiceOKBodyMongodb) contextValidateRtaMongodbAgent(ctx context.Con } func (o *AddServiceOKBodyMongodb) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -2685,15 +2511,11 @@ func (o *AddServiceOKBodyMongodb) contextValidateService(ctx context.Context, fo } if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "service") } - return err } } @@ -2724,6 +2546,7 @@ AddServiceOKBodyMongodbMongodbExporter MongoDBExporter runs on Generic or Contai swagger:model AddServiceOKBodyMongodbMongodbExporter */ type AddServiceOKBodyMongodbMongodbExporter struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -2754,18 +2577,6 @@ type AddServiceOKBodyMongodbMongodbExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` @@ -2782,35 +2593,47 @@ type AddServiceOKBodyMongodbMongodbExporter struct { // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces ExposeExporter bool `json:"expose_exporter,omitempty"` // Environment variable names passed to the exporter. EnvironmentVariableNames []string `json:"environment_variable_names"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // metrics resolutions MetricsResolutions *AddServiceOKBodyMongodbMongodbExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` } // Validate validates this add service OK body mongodb mongodb exporter func (o *AddServiceOKBodyMongodbMongodbExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -2820,67 +2643,7 @@ func (o *AddServiceOKBodyMongodbMongodbExporter) Validate(formats strfmt.Registr return nil } -var addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum = append(addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyMongodbMongodbExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyMongodbMongodbExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"mongodb_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyMongodbMongodbExporterTypeLogLevelPropEnum []any +var addServiceOkBodyMongodbMongodbExporterTypeLogLevelPropEnum []interface{} func init() { var res []string @@ -2941,15 +2704,11 @@ func (o *AddServiceOKBodyMongodbMongodbExporter) validateMetricsResolutions(form if o.MetricsResolutions != nil { if err := o.MetricsResolutions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter" + "." + "metrics_resolutions") } - return err } } @@ -2957,6 +2716,66 @@ func (o *AddServiceOKBodyMongodbMongodbExporter) validateMetricsResolutions(form return nil } +var addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum = append(addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyMongodbMongodbExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyMongodbMongodbExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"mongodb_exporter"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + // ContextValidate validate this add service OK body mongodb mongodb exporter based on the context it is used func (o *AddServiceOKBodyMongodbMongodbExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -2972,6 +2791,7 @@ func (o *AddServiceOKBodyMongodbMongodbExporter) ContextValidate(ctx context.Con } func (o *AddServiceOKBodyMongodbMongodbExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { + if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -2979,15 +2799,11 @@ func (o *AddServiceOKBodyMongodbMongodbExporter) contextValidateMetricsResolutio } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter" + "." + "metrics_resolutions") } - return err } } @@ -3018,6 +2834,7 @@ AddServiceOKBodyMongodbMongodbExporterMetricsResolutions MetricsResolutions repr swagger:model AddServiceOKBodyMongodbMongodbExporterMetricsResolutions */ type AddServiceOKBodyMongodbMongodbExporterMetricsResolutions struct { + // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -3061,6 +2878,7 @@ AddServiceOKBodyMongodbQANMongodbMongolog QANMongoDBMongologAgent runs within pm swagger:model AddServiceOKBodyMongodbQANMongodbMongolog */ type AddServiceOKBodyMongodbQANMongodbMongolog struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -3088,6 +2906,15 @@ type AddServiceOKBodyMongodbQANMongodbMongolog struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -3099,26 +2926,17 @@ type AddServiceOKBodyMongodbQANMongodbMongolog struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` } // Validate validates this add service OK body mongodb QAN mongodb mongolog func (o *AddServiceOKBodyMongodbQANMongodbMongolog) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -3128,7 +2946,61 @@ func (o *AddServiceOKBodyMongodbQANMongodbMongolog) Validate(formats strfmt.Regi return nil } -var addServiceOkBodyMongodbQanMongodbMongologTypeStatusPropEnum []any +var addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum = append(addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + + // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + + // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + + // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + + // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + + // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" +) + +// prop value enum +func (o *AddServiceOKBodyMongodbQANMongodbMongolog) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyMongodbQANMongodbMongolog) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required + return nil + } + + // value enum + if err := o.validateLogLevelEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_mongolog"+"."+"log_level", "body", *o.LogLevel); err != nil { + return err + } + + return nil +} + +var addServiceOkBodyMongodbQanMongodbMongologTypeStatusPropEnum []interface{} func init() { var res []string @@ -3188,71 +3060,17 @@ func (o *AddServiceOKBodyMongodbQANMongodbMongolog) validateStatus(formats strfm return nil } -var addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum []any +// ContextValidate validates this add service OK body mongodb QAN mongodb mongolog based on context it is used +func (o *AddServiceOKBodyMongodbQANMongodbMongolog) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} -func init() { - var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum = append(addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum, v) +// MarshalBinary interface implementation +func (o *AddServiceOKBodyMongodbQANMongodbMongolog) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil } -} - -const ( - - // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceOKBodyMongodbQANMongodbMongolog) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyMongodbQANMongodbMongolog) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_mongolog"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service OK body mongodb QAN mongodb mongolog based on context it is used -func (o *AddServiceOKBodyMongodbQANMongodbMongolog) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMongodbQANMongodbMongolog) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) + return swag.WriteJSON(o) } // UnmarshalBinary interface implementation @@ -3270,6 +3088,7 @@ AddServiceOKBodyMongodbQANMongodbProfiler QANMongoDBProfilerAgent runs within pm swagger:model AddServiceOKBodyMongodbQANMongodbProfiler */ type AddServiceOKBodyMongodbQANMongodbProfiler struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -3297,6 +3116,15 @@ type AddServiceOKBodyMongodbQANMongodbProfiler struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -3308,26 +3136,17 @@ type AddServiceOKBodyMongodbQANMongodbProfiler struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` } // Validate validates this add service OK body mongodb QAN mongodb profiler func (o *AddServiceOKBodyMongodbQANMongodbProfiler) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -3337,114 +3156,114 @@ func (o *AddServiceOKBodyMongodbQANMongodbProfiler) Validate(formats strfmt.Regi return nil } -var addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum []any +var addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum = append(addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum, v) + addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum = append(addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_profiler"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_profiler"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } return nil } -var addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum []any +var addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum = append(addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum, v) + addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum = append(addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" ) // prop value enum -func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum, true); err != nil { +func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required +func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_profiler"+"."+"log_level", "body", *o.LogLevel); err != nil { + if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_profiler"+"."+"status", "body", *o.Status); err != nil { return err } @@ -3479,6 +3298,7 @@ AddServiceOKBodyMongodbRtaMongodbAgent RTAMongoDBAgent runs within pmm-agent and swagger:model AddServiceOKBodyMongodbRtaMongodbAgent */ type AddServiceOKBodyMongodbRtaMongodbAgent struct { + // Unique agent identifier. AgentID string `json:"agent_id,omitempty"` @@ -3503,6 +3323,15 @@ type AddServiceOKBodyMongodbRtaMongodbAgent struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + + // rta options + RtaOptions *AddServiceOKBodyMongodbRtaMongodbAgentRtaOptions `json:"rta_options,omitempty"` + // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -3514,30 +3343,21 @@ type AddServiceOKBodyMongodbRtaMongodbAgent struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - - // rta options - RtaOptions *AddServiceOKBodyMongodbRtaMongodbAgentRtaOptions `json:"rta_options,omitempty"` } // Validate validates this add service OK body mongodb rta mongodb agent func (o *AddServiceOKBodyMongodbRtaMongodbAgent) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateRtaOptions(formats); err != nil { res = append(res, err) } - if err := o.validateRtaOptions(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -3547,67 +3367,7 @@ func (o *AddServiceOKBodyMongodbRtaMongodbAgent) Validate(formats strfmt.Registr return nil } -var addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum = append(addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyMongodbRtaMongodbAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyMongodbRtaMongodbAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"rta_mongodb_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyMongodbRtaMongodbAgentTypeLogLevelPropEnum []any +var addServiceOkBodyMongodbRtaMongodbAgentTypeLogLevelPropEnum []interface{} func init() { var res []string @@ -3668,15 +3428,11 @@ func (o *AddServiceOKBodyMongodbRtaMongodbAgent) validateRtaOptions(formats strf if o.RtaOptions != nil { if err := o.RtaOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent" + "." + "rta_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent" + "." + "rta_options") } - return err } } @@ -3684,14 +3440,74 @@ func (o *AddServiceOKBodyMongodbRtaMongodbAgent) validateRtaOptions(formats strf return nil } -// ContextValidate validate this add service OK body mongodb rta mongodb agent based on the context it is used -func (o *AddServiceOKBodyMongodbRtaMongodbAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error +var addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum []interface{} - if err := o.contextValidateRtaOptions(ctx, formats); err != nil { - res = append(res, err) +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) } - + for _, v := range res { + addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum = append(addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyMongodbRtaMongodbAgent) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyMongodbRtaMongodbAgent) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"rta_mongodb_agent"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this add service OK body mongodb rta mongodb agent based on the context it is used +func (o *AddServiceOKBodyMongodbRtaMongodbAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateRtaOptions(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -3699,6 +3515,7 @@ func (o *AddServiceOKBodyMongodbRtaMongodbAgent) ContextValidate(ctx context.Con } func (o *AddServiceOKBodyMongodbRtaMongodbAgent) contextValidateRtaOptions(ctx context.Context, formats strfmt.Registry) error { + if o.RtaOptions != nil { if swag.IsZero(o.RtaOptions) { // not required @@ -3706,15 +3523,11 @@ func (o *AddServiceOKBodyMongodbRtaMongodbAgent) contextValidateRtaOptions(ctx c } if err := o.RtaOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent" + "." + "rta_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent" + "." + "rta_options") } - return err } } @@ -3745,6 +3558,7 @@ AddServiceOKBodyMongodbRtaMongodbAgentRtaOptions RTAOptions holds Real-Time Quer swagger:model AddServiceOKBodyMongodbRtaMongodbAgentRtaOptions */ type AddServiceOKBodyMongodbRtaMongodbAgentRtaOptions struct { + // Query collect interval (default 2s is set by server). CollectInterval string `json:"collect_interval,omitempty"` } @@ -3782,6 +3596,7 @@ AddServiceOKBodyMongodbService MongoDBService represents a generic MongoDB insta swagger:model AddServiceOKBodyMongodbService */ type AddServiceOKBodyMongodbService struct { + // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -3852,6 +3667,7 @@ AddServiceOKBodyMysql add service OK body mysql swagger:model AddServiceOKBodyMysql */ type AddServiceOKBodyMysql struct { + // Actual table count at the moment of adding. TableCount int32 `json:"table_count,omitempty"` @@ -3901,15 +3717,11 @@ func (o *AddServiceOKBodyMysql) validateMysqldExporter(formats strfmt.Registry) if o.MysqldExporter != nil { if err := o.MysqldExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter") } - return err } } @@ -3924,15 +3736,11 @@ func (o *AddServiceOKBodyMysql) validateQANMysqlPerfschema(formats strfmt.Regist if o.QANMysqlPerfschema != nil { if err := o.QANMysqlPerfschema.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_perfschema") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_perfschema") } - return err } } @@ -3947,15 +3755,11 @@ func (o *AddServiceOKBodyMysql) validateQANMysqlSlowlog(formats strfmt.Registry) if o.QANMysqlSlowlog != nil { if err := o.QANMysqlSlowlog.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_slowlog") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_slowlog") } - return err } } @@ -3970,15 +3774,11 @@ func (o *AddServiceOKBodyMysql) validateService(formats strfmt.Registry) error { if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "service") } - return err } } @@ -4013,6 +3813,7 @@ func (o *AddServiceOKBodyMysql) ContextValidate(ctx context.Context, formats str } func (o *AddServiceOKBodyMysql) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { + if o.MysqldExporter != nil { if swag.IsZero(o.MysqldExporter) { // not required @@ -4020,15 +3821,11 @@ func (o *AddServiceOKBodyMysql) contextValidateMysqldExporter(ctx context.Contex } if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter") } - return err } } @@ -4037,6 +3834,7 @@ func (o *AddServiceOKBodyMysql) contextValidateMysqldExporter(ctx context.Contex } func (o *AddServiceOKBodyMysql) contextValidateQANMysqlPerfschema(ctx context.Context, formats strfmt.Registry) error { + if o.QANMysqlPerfschema != nil { if swag.IsZero(o.QANMysqlPerfschema) { // not required @@ -4044,15 +3842,11 @@ func (o *AddServiceOKBodyMysql) contextValidateQANMysqlPerfschema(ctx context.Co } if err := o.QANMysqlPerfschema.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_perfschema") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_perfschema") } - return err } } @@ -4061,6 +3855,7 @@ func (o *AddServiceOKBodyMysql) contextValidateQANMysqlPerfschema(ctx context.Co } func (o *AddServiceOKBodyMysql) contextValidateQANMysqlSlowlog(ctx context.Context, formats strfmt.Registry) error { + if o.QANMysqlSlowlog != nil { if swag.IsZero(o.QANMysqlSlowlog) { // not required @@ -4068,15 +3863,11 @@ func (o *AddServiceOKBodyMysql) contextValidateQANMysqlSlowlog(ctx context.Conte } if err := o.QANMysqlSlowlog.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_slowlog") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_slowlog") } - return err } } @@ -4085,6 +3876,7 @@ func (o *AddServiceOKBodyMysql) contextValidateQANMysqlSlowlog(ctx context.Conte } func (o *AddServiceOKBodyMysql) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -4092,15 +3884,11 @@ func (o *AddServiceOKBodyMysql) contextValidateService(ctx context.Context, form } if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "service") } - return err } } @@ -4131,6 +3919,7 @@ AddServiceOKBodyMysqlMysqldExporter MySQLdExporter runs on Generic or Container swagger:model AddServiceOKBodyMysqlMysqldExporter */ type AddServiceOKBodyMysqlMysqldExporter struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -4178,18 +3967,6 @@ type AddServiceOKBodyMysqlMysqldExporter struct { // Actual table count at the moment of adding. TableCount int32 `json:"table_count,omitempty"` - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` @@ -4199,35 +3976,47 @@ type AddServiceOKBodyMysqlMysqldExporter struct { // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces ExposeExporter bool `json:"expose_exporter,omitempty"` // Extra DSN parameters for MySQL connection. ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // metrics resolutions MetricsResolutions *AddServiceOKBodyMysqlMysqldExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` } // Validate validates this add service OK body mysql mysqld exporter func (o *AddServiceOKBodyMysqlMysqldExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -4237,67 +4026,7 @@ func (o *AddServiceOKBodyMysqlMysqldExporter) Validate(formats strfmt.Registry) return nil } -var addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum = append(addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyMysqlMysqldExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyMysqlMysqldExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"mysqld_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyMysqlMysqldExporterTypeLogLevelPropEnum []any +var addServiceOkBodyMysqlMysqldExporterTypeLogLevelPropEnum []interface{} func init() { var res []string @@ -4358,15 +4087,11 @@ func (o *AddServiceOKBodyMysqlMysqldExporter) validateMetricsResolutions(formats if o.MetricsResolutions != nil { if err := o.MetricsResolutions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter" + "." + "metrics_resolutions") } - return err } } @@ -4374,6 +4099,66 @@ func (o *AddServiceOKBodyMysqlMysqldExporter) validateMetricsResolutions(formats return nil } +var addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum = append(addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyMysqlMysqldExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyMysqlMysqldExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"mysqld_exporter"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + // ContextValidate validate this add service OK body mysql mysqld exporter based on the context it is used func (o *AddServiceOKBodyMysqlMysqldExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -4389,6 +4174,7 @@ func (o *AddServiceOKBodyMysqlMysqldExporter) ContextValidate(ctx context.Contex } func (o *AddServiceOKBodyMysqlMysqldExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { + if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -4396,15 +4182,11 @@ func (o *AddServiceOKBodyMysqlMysqldExporter) contextValidateMetricsResolutions( } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter" + "." + "metrics_resolutions") } - return err } } @@ -4435,6 +4217,7 @@ AddServiceOKBodyMysqlMysqldExporterMetricsResolutions MetricsResolutions represe swagger:model AddServiceOKBodyMysqlMysqldExporterMetricsResolutions */ type AddServiceOKBodyMysqlMysqldExporterMetricsResolutions struct { + // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -4478,6 +4261,7 @@ AddServiceOKBodyMysqlQANMysqlPerfschema QANMySQLPerfSchemaAgent runs within pmm- swagger:model AddServiceOKBodyMysqlQANMysqlPerfschema */ type AddServiceOKBodyMysqlQANMysqlPerfschema struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -4520,7 +4304,19 @@ type AddServiceOKBodyMysqlQANMysqlPerfschema struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // AgentStatus represents actual Agent status. + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Extra DSN parameters for MySQL connection. + ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + + // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. @@ -4531,29 +4327,17 @@ type AddServiceOKBodyMysqlQANMysqlPerfschema struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` } // Validate validates this add service OK body mysql QAN mysql perfschema func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -4563,114 +4347,114 @@ func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) Validate(formats strfmt.Regist return nil } -var addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum []any +var addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum = append(addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum, v) + addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum = append(addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_perfschema"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_perfschema"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } return nil } -var addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum []any +var addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum = append(addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum, v) + addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum = append(addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" ) // prop value enum -func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum, true); err != nil { +func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required +func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_perfschema"+"."+"log_level", "body", *o.LogLevel); err != nil { + if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_perfschema"+"."+"status", "body", *o.Status); err != nil { return err } @@ -4705,6 +4489,7 @@ AddServiceOKBodyMysqlQANMysqlSlowlog QANMySQLSlowlogAgent runs within pmm-agent swagger:model AddServiceOKBodyMysqlQANMysqlSlowlog */ type AddServiceOKBodyMysqlQANMysqlSlowlog struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -4750,6 +4535,18 @@ type AddServiceOKBodyMysqlQANMysqlSlowlog struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` + // mod tidy + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Extra DSN parameters for MySQL connection. + ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -4761,29 +4558,17 @@ type AddServiceOKBodyMysqlQANMysqlSlowlog struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` - - // mod tidy - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` } // Validate validates this add service OK body mysql QAN mysql slowlog func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -4793,114 +4578,114 @@ func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) Validate(formats strfmt.Registry) return nil } -var addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum []any +var addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum = append(addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum, v) + addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum = append(addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_slowlog"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_slowlog"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } return nil } -var addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum []any +var addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum = append(addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum, v) + addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum = append(addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" ) // prop value enum -func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum, true); err != nil { +func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required +func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_slowlog"+"."+"log_level", "body", *o.LogLevel); err != nil { + if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_slowlog"+"."+"status", "body", *o.Status); err != nil { return err } @@ -4935,6 +4720,7 @@ AddServiceOKBodyMysqlService MySQLService represents a generic MySQL instance. swagger:model AddServiceOKBodyMysqlService */ type AddServiceOKBodyMysqlService struct { + // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -5008,6 +4794,7 @@ AddServiceOKBodyPostgresql add service OK body postgresql swagger:model AddServiceOKBodyPostgresql */ type AddServiceOKBodyPostgresql struct { + // Warning message. Warning string `json:"warning,omitempty"` @@ -5057,15 +4844,11 @@ func (o *AddServiceOKBodyPostgresql) validatePostgresExporter(formats strfmt.Reg if o.PostgresExporter != nil { if err := o.PostgresExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter") } - return err } } @@ -5080,15 +4863,11 @@ func (o *AddServiceOKBodyPostgresql) validateQANPostgresqlPgstatementsAgent(form if o.QANPostgresqlPgstatementsAgent != nil { if err := o.QANPostgresqlPgstatementsAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatements_agent") } - return err } } @@ -5103,15 +4882,11 @@ func (o *AddServiceOKBodyPostgresql) validateQANPostgresqlPgstatmonitorAgent(for if o.QANPostgresqlPgstatmonitorAgent != nil { if err := o.QANPostgresqlPgstatmonitorAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatmonitor_agent") } - return err } } @@ -5126,15 +4901,11 @@ func (o *AddServiceOKBodyPostgresql) validateService(formats strfmt.Registry) er if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "service") } - return err } } @@ -5169,6 +4940,7 @@ func (o *AddServiceOKBodyPostgresql) ContextValidate(ctx context.Context, format } func (o *AddServiceOKBodyPostgresql) contextValidatePostgresExporter(ctx context.Context, formats strfmt.Registry) error { + if o.PostgresExporter != nil { if swag.IsZero(o.PostgresExporter) { // not required @@ -5176,15 +4948,11 @@ func (o *AddServiceOKBodyPostgresql) contextValidatePostgresExporter(ctx context } if err := o.PostgresExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter") } - return err } } @@ -5193,6 +4961,7 @@ func (o *AddServiceOKBodyPostgresql) contextValidatePostgresExporter(ctx context } func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatementsAgent(ctx context.Context, formats strfmt.Registry) error { + if o.QANPostgresqlPgstatementsAgent != nil { if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required @@ -5200,15 +4969,11 @@ func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatementsAge } if err := o.QANPostgresqlPgstatementsAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatements_agent") } - return err } } @@ -5217,6 +4982,7 @@ func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatementsAge } func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatmonitorAgent(ctx context.Context, formats strfmt.Registry) error { + if o.QANPostgresqlPgstatmonitorAgent != nil { if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required @@ -5224,15 +4990,11 @@ func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatmonitorAg } if err := o.QANPostgresqlPgstatmonitorAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatmonitor_agent") } - return err } } @@ -5241,6 +5003,7 @@ func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatmonitorAg } func (o *AddServiceOKBodyPostgresql) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -5248,15 +5011,11 @@ func (o *AddServiceOKBodyPostgresql) contextValidateService(ctx context.Context, } if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "service") } - return err } } @@ -5287,6 +5046,7 @@ AddServiceOKBodyPostgresqlPostgresExporter PostgresExporter runs on Generic or C swagger:model AddServiceOKBodyPostgresqlPostgresExporter */ type AddServiceOKBodyPostgresqlPostgresExporter struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -5317,30 +5077,12 @@ type AddServiceOKBodyPostgresqlPostgresExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // Limit of databases for auto-discovery. AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` @@ -5350,23 +5092,41 @@ type AddServiceOKBodyPostgresqlPostgresExporter struct { // Maximum number of connections that exporter can open to the database instance. MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // metrics resolutions MetricsResolutions *AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` } // Validate validates this add service OK body postgresql postgres exporter func (o *AddServiceOKBodyPostgresqlPostgresExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -5376,67 +5136,7 @@ func (o *AddServiceOKBodyPostgresqlPostgresExporter) Validate(formats strfmt.Reg return nil } -var addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum = append(addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"postgresql"+"."+"postgres_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyPostgresqlPostgresExporterTypeLogLevelPropEnum []any +var addServiceOkBodyPostgresqlPostgresExporterTypeLogLevelPropEnum []interface{} func init() { var res []string @@ -5497,15 +5197,11 @@ func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateMetricsResolutions( if o.MetricsResolutions != nil { if err := o.MetricsResolutions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter" + "." + "metrics_resolutions") } - return err } } @@ -5513,6 +5209,66 @@ func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateMetricsResolutions( return nil } +var addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum = append(addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"postgresql"+"."+"postgres_exporter"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + // ContextValidate validate this add service OK body postgresql postgres exporter based on the context it is used func (o *AddServiceOKBodyPostgresqlPostgresExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -5528,6 +5284,7 @@ func (o *AddServiceOKBodyPostgresqlPostgresExporter) ContextValidate(ctx context } func (o *AddServiceOKBodyPostgresqlPostgresExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { + if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -5535,15 +5292,11 @@ func (o *AddServiceOKBodyPostgresqlPostgresExporter) contextValidateMetricsResol } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter" + "." + "metrics_resolutions") } - return err } } @@ -5574,6 +5327,7 @@ AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions MetricsResolutions swagger:model AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions */ type AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions struct { + // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -5617,6 +5371,7 @@ AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent QANPostgreSQLPgStatemen swagger:model AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent */ type AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -5647,6 +5402,15 @@ type AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -5658,26 +5422,17 @@ type AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` } // Validate validates this add service OK body postgresql QAN postgresql pgstatements agent func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -5687,7 +5442,61 @@ func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) Validate(form return nil } -var addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeStatusPropEnum []any +var addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" +) + +// prop value enum +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required + return nil + } + + // value enum + if err := o.validateLogLevelEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatements_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { + return err + } + + return nil +} + +var addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeStatusPropEnum []interface{} func init() { var res []string @@ -5747,63 +5556,9 @@ func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) validateStatu return nil } -var addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatements_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service OK body postgresql QAN postgresql pgstatements agent based on context it is used -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil +// ContextValidate validates this add service OK body postgresql QAN postgresql pgstatements agent based on context it is used +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil } // MarshalBinary interface implementation @@ -5829,6 +5584,7 @@ AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent QANPostgreSQLPgStatMon swagger:model AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent */ type AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -5862,6 +5618,15 @@ type AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -5873,26 +5638,17 @@ type AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` } // Validate validates this add service OK body postgresql QAN postgresql pgstatmonitor agent func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -5902,114 +5658,114 @@ func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) Validate(for return nil } -var addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum []any +var addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, v) + addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } return nil } -var addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum []any +var addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, v) + addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" ) // prop value enum -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, true); err != nil { +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { + if err := o.validateStatusEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"status", "body", *o.Status); err != nil { return err } @@ -6044,6 +5800,7 @@ AddServiceOKBodyPostgresqlService PostgreSQLService represents a generic Postgre swagger:model AddServiceOKBodyPostgresqlService */ type AddServiceOKBodyPostgresqlService struct { + // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -6120,6 +5877,7 @@ AddServiceOKBodyProxysql add service OK body proxysql swagger:model AddServiceOKBodyProxysql */ type AddServiceOKBodyProxysql struct { + // proxysql exporter ProxysqlExporter *AddServiceOKBodyProxysqlProxysqlExporter `json:"proxysql_exporter,omitempty"` @@ -6152,15 +5910,11 @@ func (o *AddServiceOKBodyProxysql) validateProxysqlExporter(formats strfmt.Regis if o.ProxysqlExporter != nil { if err := o.ProxysqlExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter") } - return err } } @@ -6175,15 +5929,11 @@ func (o *AddServiceOKBodyProxysql) validateService(formats strfmt.Registry) erro if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "service") } - return err } } @@ -6210,6 +5960,7 @@ func (o *AddServiceOKBodyProxysql) ContextValidate(ctx context.Context, formats } func (o *AddServiceOKBodyProxysql) contextValidateProxysqlExporter(ctx context.Context, formats strfmt.Registry) error { + if o.ProxysqlExporter != nil { if swag.IsZero(o.ProxysqlExporter) { // not required @@ -6217,15 +5968,11 @@ func (o *AddServiceOKBodyProxysql) contextValidateProxysqlExporter(ctx context.C } if err := o.ProxysqlExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter") } - return err } } @@ -6234,6 +5981,7 @@ func (o *AddServiceOKBodyProxysql) contextValidateProxysqlExporter(ctx context.C } func (o *AddServiceOKBodyProxysql) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -6241,15 +5989,11 @@ func (o *AddServiceOKBodyProxysql) contextValidateService(ctx context.Context, f } if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "service") } - return err } } @@ -6280,6 +6024,7 @@ AddServiceOKBodyProxysqlProxysqlExporter ProxySQLExporter runs on Generic or Con swagger:model AddServiceOKBodyProxysqlProxysqlExporter */ type AddServiceOKBodyProxysqlProxysqlExporter struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -6310,50 +6055,50 @@ type AddServiceOKBodyProxysqlProxysqlExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` + // Optionally expose the exporter process on all public interfaces + ExposeExporter bool `json:"expose_exporter,omitempty"` + // Log level for exporters // // - LOG_LEVEL_UNSPECIFIED: Auto // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] LogLevel *string `json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - // metrics resolutions MetricsResolutions *AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` } // Validate validates this add service OK body proxysql proxysql exporter func (o *AddServiceOKBodyProxysqlProxysqlExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -6363,143 +6108,139 @@ func (o *AddServiceOKBodyProxysqlProxysqlExporter) Validate(formats strfmt.Regis return nil } -var addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum []any +var addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum = append(addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum, v) + addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum = append(addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"proxysql"+"."+"proxysql_exporter"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"proxysql"+"."+"proxysql_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } return nil } -var addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum []any +func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateMetricsResolutions(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsResolutions) { // not required + return nil + } -func init() { - var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if o.MetricsResolutions != nil { + if err := o.MetricsResolutions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter" + "." + "metrics_resolutions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter" + "." + "metrics_resolutions") + } + return err + } + } + + return nil +} + +var addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum = append(addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum, v) + addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum = append(addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" ) // prop value enum -func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum, true); err != nil { +func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required +func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"proxysql"+"."+"proxysql_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { + if err := o.validateStatusEnum("addServiceOk"+"."+"proxysql"+"."+"proxysql_exporter"+"."+"status", "body", *o.Status); err != nil { return err } return nil } -func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateMetricsResolutions(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsResolutions) { // not required - return nil - } - - if o.MetricsResolutions != nil { - if err := o.MetricsResolutions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - // ContextValidate validate this add service OK body proxysql proxysql exporter based on the context it is used func (o *AddServiceOKBodyProxysqlProxysqlExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -6515,6 +6256,7 @@ func (o *AddServiceOKBodyProxysqlProxysqlExporter) ContextValidate(ctx context.C } func (o *AddServiceOKBodyProxysqlProxysqlExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { + if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -6522,15 +6264,11 @@ func (o *AddServiceOKBodyProxysqlProxysqlExporter) contextValidateMetricsResolut } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter" + "." + "metrics_resolutions") } - return err } } @@ -6561,6 +6299,7 @@ AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions MetricsResolutions re swagger:model AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions */ type AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions struct { + // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -6604,6 +6343,7 @@ AddServiceOKBodyProxysqlService ProxySQLService represents a generic ProxySQL in swagger:model AddServiceOKBodyProxysqlService */ type AddServiceOKBodyProxysqlService struct { + // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -6674,6 +6414,7 @@ AddServiceOKBodyRDS add service OK body RDS swagger:model AddServiceOKBodyRDS */ type AddServiceOKBodyRDS struct { + // mysql Mysql *AddServiceOKBodyRDSMysql `json:"mysql,omitempty"` @@ -6748,15 +6489,11 @@ func (o *AddServiceOKBodyRDS) validateMysql(formats strfmt.Registry) error { if o.Mysql != nil { if err := o.Mysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysql") } - return err } } @@ -6771,15 +6508,11 @@ func (o *AddServiceOKBodyRDS) validateMysqldExporter(formats strfmt.Registry) er if o.MysqldExporter != nil { if err := o.MysqldExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter") } - return err } } @@ -6794,15 +6527,11 @@ func (o *AddServiceOKBodyRDS) validateNode(formats strfmt.Registry) error { if o.Node != nil { if err := o.Node.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "node") } - return err } } @@ -6817,15 +6546,11 @@ func (o *AddServiceOKBodyRDS) validatePostgresql(formats strfmt.Registry) error if o.Postgresql != nil { if err := o.Postgresql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql") } - return err } } @@ -6840,15 +6565,11 @@ func (o *AddServiceOKBodyRDS) validatePostgresqlExporter(formats strfmt.Registry if o.PostgresqlExporter != nil { if err := o.PostgresqlExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter") } - return err } } @@ -6863,15 +6584,11 @@ func (o *AddServiceOKBodyRDS) validateQANMysqlPerfschema(formats strfmt.Registry if o.QANMysqlPerfschema != nil { if err := o.QANMysqlPerfschema.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_mysql_perfschema") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_mysql_perfschema") } - return err } } @@ -6886,15 +6603,11 @@ func (o *AddServiceOKBodyRDS) validateQANPostgresqlPgstatements(formats strfmt.R if o.QANPostgresqlPgstatements != nil { if err := o.QANPostgresqlPgstatements.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_postgresql_pgstatements") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_postgresql_pgstatements") } - return err } } @@ -6909,15 +6622,11 @@ func (o *AddServiceOKBodyRDS) validateRDSExporter(formats strfmt.Registry) error if o.RDSExporter != nil { if err := o.RDSExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter") } - return err } } @@ -6968,6 +6677,7 @@ func (o *AddServiceOKBodyRDS) ContextValidate(ctx context.Context, formats strfm } func (o *AddServiceOKBodyRDS) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { + if o.Mysql != nil { if swag.IsZero(o.Mysql) { // not required @@ -6975,15 +6685,11 @@ func (o *AddServiceOKBodyRDS) contextValidateMysql(ctx context.Context, formats } if err := o.Mysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysql") } - return err } } @@ -6992,6 +6698,7 @@ func (o *AddServiceOKBodyRDS) contextValidateMysql(ctx context.Context, formats } func (o *AddServiceOKBodyRDS) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { + if o.MysqldExporter != nil { if swag.IsZero(o.MysqldExporter) { // not required @@ -6999,15 +6706,11 @@ func (o *AddServiceOKBodyRDS) contextValidateMysqldExporter(ctx context.Context, } if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter") } - return err } } @@ -7016,6 +6719,7 @@ func (o *AddServiceOKBodyRDS) contextValidateMysqldExporter(ctx context.Context, } func (o *AddServiceOKBodyRDS) contextValidateNode(ctx context.Context, formats strfmt.Registry) error { + if o.Node != nil { if swag.IsZero(o.Node) { // not required @@ -7023,15 +6727,11 @@ func (o *AddServiceOKBodyRDS) contextValidateNode(ctx context.Context, formats s } if err := o.Node.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "node") } - return err } } @@ -7040,6 +6740,7 @@ func (o *AddServiceOKBodyRDS) contextValidateNode(ctx context.Context, formats s } func (o *AddServiceOKBodyRDS) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { + if o.Postgresql != nil { if swag.IsZero(o.Postgresql) { // not required @@ -7047,15 +6748,11 @@ func (o *AddServiceOKBodyRDS) contextValidatePostgresql(ctx context.Context, for } if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql") } - return err } } @@ -7064,6 +6761,7 @@ func (o *AddServiceOKBodyRDS) contextValidatePostgresql(ctx context.Context, for } func (o *AddServiceOKBodyRDS) contextValidatePostgresqlExporter(ctx context.Context, formats strfmt.Registry) error { + if o.PostgresqlExporter != nil { if swag.IsZero(o.PostgresqlExporter) { // not required @@ -7071,15 +6769,11 @@ func (o *AddServiceOKBodyRDS) contextValidatePostgresqlExporter(ctx context.Cont } if err := o.PostgresqlExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter") } - return err } } @@ -7088,6 +6782,7 @@ func (o *AddServiceOKBodyRDS) contextValidatePostgresqlExporter(ctx context.Cont } func (o *AddServiceOKBodyRDS) contextValidateQANMysqlPerfschema(ctx context.Context, formats strfmt.Registry) error { + if o.QANMysqlPerfschema != nil { if swag.IsZero(o.QANMysqlPerfschema) { // not required @@ -7095,15 +6790,11 @@ func (o *AddServiceOKBodyRDS) contextValidateQANMysqlPerfschema(ctx context.Cont } if err := o.QANMysqlPerfschema.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_mysql_perfschema") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_mysql_perfschema") } - return err } } @@ -7112,6 +6803,7 @@ func (o *AddServiceOKBodyRDS) contextValidateQANMysqlPerfschema(ctx context.Cont } func (o *AddServiceOKBodyRDS) contextValidateQANPostgresqlPgstatements(ctx context.Context, formats strfmt.Registry) error { + if o.QANPostgresqlPgstatements != nil { if swag.IsZero(o.QANPostgresqlPgstatements) { // not required @@ -7119,15 +6811,11 @@ func (o *AddServiceOKBodyRDS) contextValidateQANPostgresqlPgstatements(ctx conte } if err := o.QANPostgresqlPgstatements.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_postgresql_pgstatements") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_postgresql_pgstatements") } - return err } } @@ -7136,6 +6824,7 @@ func (o *AddServiceOKBodyRDS) contextValidateQANPostgresqlPgstatements(ctx conte } func (o *AddServiceOKBodyRDS) contextValidateRDSExporter(ctx context.Context, formats strfmt.Registry) error { + if o.RDSExporter != nil { if swag.IsZero(o.RDSExporter) { // not required @@ -7143,15 +6832,11 @@ func (o *AddServiceOKBodyRDS) contextValidateRDSExporter(ctx context.Context, fo } if err := o.RDSExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter") } - return err } } @@ -7182,6 +6867,7 @@ AddServiceOKBodyRDSMysql MySQLService represents a generic MySQL instance. swagger:model AddServiceOKBodyRDSMysql */ type AddServiceOKBodyRDSMysql struct { + // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -7255,6 +6941,7 @@ AddServiceOKBodyRDSMysqldExporter MySQLdExporter runs on Generic or Container No swagger:model AddServiceOKBodyRDSMysqldExporter */ type AddServiceOKBodyRDSMysqldExporter struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -7302,18 +6989,6 @@ type AddServiceOKBodyRDSMysqldExporter struct { // Actual table count at the moment of adding. TableCount int32 `json:"table_count,omitempty"` - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` @@ -7323,35 +6998,47 @@ type AddServiceOKBodyRDSMysqldExporter struct { // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces ExposeExporter bool `json:"expose_exporter,omitempty"` // Extra DSN parameters for MySQL connection. ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // metrics resolutions MetricsResolutions *AddServiceOKBodyRDSMysqldExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` } // Validate validates this add service OK body RDS mysqld exporter func (o *AddServiceOKBodyRDSMysqldExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -7361,67 +7048,7 @@ func (o *AddServiceOKBodyRDSMysqldExporter) Validate(formats strfmt.Registry) er return nil } -var addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum = append(addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyRDSMysqldExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyRDSMysqldExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"mysqld_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyRdsMysqldExporterTypeLogLevelPropEnum []any +var addServiceOkBodyRdsMysqldExporterTypeLogLevelPropEnum []interface{} func init() { var res []string @@ -7482,15 +7109,11 @@ func (o *AddServiceOKBodyRDSMysqldExporter) validateMetricsResolutions(formats s if o.MetricsResolutions != nil { if err := o.MetricsResolutions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter" + "." + "metrics_resolutions") } - return err } } @@ -7498,37 +7121,94 @@ func (o *AddServiceOKBodyRDSMysqldExporter) validateMetricsResolutions(formats s return nil } -// ContextValidate validate this add service OK body RDS mysqld exporter based on the context it is used -func (o *AddServiceOKBodyRDSMysqldExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error +var addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum []interface{} - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) + for _, v := range res { + addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum = append(addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum, v) } - return nil } -func (o *AddServiceOKBodyRDSMysqldExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { - if o.MetricsResolutions != nil { +const ( - if swag.IsZero(o.MetricsResolutions) { // not required - return nil - } + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyRDSMysqldExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyRDSMysqldExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"mysqld_exporter"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this add service OK body RDS mysqld exporter based on the context it is used +func (o *AddServiceOKBodyRDSMysqldExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddServiceOKBodyRDSMysqldExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { + + if o.MetricsResolutions != nil { + + if swag.IsZero(o.MetricsResolutions) { // not required + return nil + } + if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter" + "." + "metrics_resolutions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter" + "." + "metrics_resolutions") + } return err } } @@ -7559,6 +7239,7 @@ AddServiceOKBodyRDSMysqldExporterMetricsResolutions MetricsResolutions represent swagger:model AddServiceOKBodyRDSMysqldExporterMetricsResolutions */ type AddServiceOKBodyRDSMysqldExporterMetricsResolutions struct { + // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -7602,6 +7283,7 @@ AddServiceOKBodyRDSNode RemoteRDSNode represents remote RDS Node. Agents can't r swagger:model AddServiceOKBodyRDSNode */ type AddServiceOKBodyRDSNode struct { + // Unique randomly generated instance identifier. NodeID string `json:"node_id,omitempty"` @@ -7660,6 +7342,7 @@ AddServiceOKBodyRDSPostgresql PostgreSQLService represents a generic PostgreSQL swagger:model AddServiceOKBodyRDSPostgresql */ type AddServiceOKBodyRDSPostgresql struct { + // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -7736,6 +7419,7 @@ AddServiceOKBodyRDSPostgresqlExporter PostgresExporter runs on Generic or Contai swagger:model AddServiceOKBodyRDSPostgresqlExporter */ type AddServiceOKBodyRDSPostgresqlExporter struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -7766,30 +7450,12 @@ type AddServiceOKBodyRDSPostgresqlExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // Limit of databases for auto-discovery. AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` @@ -7799,23 +7465,41 @@ type AddServiceOKBodyRDSPostgresqlExporter struct { // Maximum number of connections that exporter can open to the database instance. MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // metrics resolutions MetricsResolutions *AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` } // Validate validates this add service OK body RDS postgresql exporter func (o *AddServiceOKBodyRDSPostgresqlExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -7825,67 +7509,7 @@ func (o *AddServiceOKBodyRDSPostgresqlExporter) Validate(formats strfmt.Registry return nil } -var addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum = append(addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyRDSPostgresqlExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyRDSPostgresqlExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"postgresql_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyRdsPostgresqlExporterTypeLogLevelPropEnum []any +var addServiceOkBodyRdsPostgresqlExporterTypeLogLevelPropEnum []interface{} func init() { var res []string @@ -7946,15 +7570,11 @@ func (o *AddServiceOKBodyRDSPostgresqlExporter) validateMetricsResolutions(forma if o.MetricsResolutions != nil { if err := o.MetricsResolutions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter" + "." + "metrics_resolutions") } - return err } } @@ -7962,6 +7582,66 @@ func (o *AddServiceOKBodyRDSPostgresqlExporter) validateMetricsResolutions(forma return nil } +var addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum = append(addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyRDSPostgresqlExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyRDSPostgresqlExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"postgresql_exporter"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + // ContextValidate validate this add service OK body RDS postgresql exporter based on the context it is used func (o *AddServiceOKBodyRDSPostgresqlExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -7977,6 +7657,7 @@ func (o *AddServiceOKBodyRDSPostgresqlExporter) ContextValidate(ctx context.Cont } func (o *AddServiceOKBodyRDSPostgresqlExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { + if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -7984,15 +7665,11 @@ func (o *AddServiceOKBodyRDSPostgresqlExporter) contextValidateMetricsResolution } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter" + "." + "metrics_resolutions") } - return err } } @@ -8023,6 +7700,7 @@ AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions MetricsResolutions repre swagger:model AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions */ type AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions struct { + // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -8066,6 +7744,7 @@ AddServiceOKBodyRDSQANMysqlPerfschema QANMySQLPerfSchemaAgent runs within pmm-ag swagger:model AddServiceOKBodyRDSQANMysqlPerfschema */ type AddServiceOKBodyRDSQANMysqlPerfschema struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -8108,6 +7787,18 @@ type AddServiceOKBodyRDSQANMysqlPerfschema struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Extra DSN parameters for MySQL connection. + ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -8119,29 +7810,17 @@ type AddServiceOKBodyRDSQANMysqlPerfschema struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` -} +} // Validate validates this add service OK body RDS QAN mysql perfschema func (o *AddServiceOKBodyRDSQANMysqlPerfschema) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -8151,114 +7830,114 @@ func (o *AddServiceOKBodyRDSQANMysqlPerfschema) Validate(formats strfmt.Registry return nil } -var addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum []any +var addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum = append(addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum, v) + addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum = append(addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"qan_mysql_perfschema"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"rds"+"."+"qan_mysql_perfschema"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } return nil } -var addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum []any +var addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum = append(addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum, v) + addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum = append(addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" ) // prop value enum -func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum, true); err != nil { +func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required +func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"rds"+"."+"qan_mysql_perfschema"+"."+"log_level", "body", *o.LogLevel); err != nil { + if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"qan_mysql_perfschema"+"."+"status", "body", *o.Status); err != nil { return err } @@ -8293,6 +7972,7 @@ AddServiceOKBodyRDSQANPostgresqlPgstatements QANPostgreSQLPgStatementsAgent runs swagger:model AddServiceOKBodyRDSQANPostgresqlPgstatements */ type AddServiceOKBodyRDSQANPostgresqlPgstatements struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -8323,6 +8003,15 @@ type AddServiceOKBodyRDSQANPostgresqlPgstatements struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -8334,26 +8023,17 @@ type AddServiceOKBodyRDSQANPostgresqlPgstatements struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` } // Validate validates this add service OK body RDS QAN postgresql pgstatements func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -8363,114 +8043,114 @@ func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) Validate(formats strfmt.R return nil } -var addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum []any +var addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum = append(addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum, v) + addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum = append(addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"qan_postgresql_pgstatements"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"rds"+"."+"qan_postgresql_pgstatements"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } return nil } -var addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum []any +var addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum = append(addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum, v) + addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum = append(addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" ) // prop value enum -func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum, true); err != nil { +func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required +func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"rds"+"."+"qan_postgresql_pgstatements"+"."+"log_level", "body", *o.LogLevel); err != nil { + if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"qan_postgresql_pgstatements"+"."+"status", "body", *o.Status); err != nil { return err } @@ -8505,6 +8185,7 @@ AddServiceOKBodyRDSRDSExporter RDSExporter runs on Generic or Container Node and swagger:model AddServiceOKBodyRDSRDSExporter */ type AddServiceOKBodyRDSRDSExporter struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -8523,18 +8204,6 @@ type AddServiceOKBodyRDSRDSExporter struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics (the same for several configurations). ListenPort int64 `json:"listen_port,omitempty"` @@ -8550,102 +8219,54 @@ type AddServiceOKBodyRDSRDSExporter struct { // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` + // Limit of databases for auto-discovery. + AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` + // Log level for exporters // // - LOG_LEVEL_UNSPECIFIED: Auto // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] LogLevel *string `json:"log_level,omitempty"` - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` - // metrics resolutions MetricsResolutions *AddServiceOKBodyRDSRDSExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this add service OK body RDS RDS exporter -func (o *AddServiceOKBodyRDSRDSExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMetricsResolutions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} -var addServiceOkBodyRdsRdsExporterTypeStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyRdsRdsExporterTypeStatusPropEnum = append(addServiceOkBodyRdsRdsExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` +} - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) +// Validate validates this add service OK body RDS RDS exporter +func (o *AddServiceOKBodyRDSRDSExporter) Validate(formats strfmt.Registry) error { + var res []error -// prop value enum -func (o *AddServiceOKBodyRDSRDSExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsRdsExporterTypeStatusPropEnum, true); err != nil { - return err + if err := o.validateLogLevel(formats); err != nil { + res = append(res, err) } - return nil -} -func (o *AddServiceOKBodyRDSRDSExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil + if err := o.validateMetricsResolutions(formats); err != nil { + res = append(res, err) } - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"rds_exporter"+"."+"status", "body", *o.Status); err != nil { - return err + if err := o.validateStatus(formats); err != nil { + res = append(res, err) } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } return nil } -var addServiceOkBodyRdsRdsExporterTypeLogLevelPropEnum []any +var addServiceOkBodyRdsRdsExporterTypeLogLevelPropEnum []interface{} func init() { var res []string @@ -8706,15 +8327,11 @@ func (o *AddServiceOKBodyRDSRDSExporter) validateMetricsResolutions(formats strf if o.MetricsResolutions != nil { if err := o.MetricsResolutions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter" + "." + "metrics_resolutions") } - return err } } @@ -8722,6 +8339,66 @@ func (o *AddServiceOKBodyRDSRDSExporter) validateMetricsResolutions(formats strf return nil } +var addServiceOkBodyRdsRdsExporterTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyRdsRdsExporterTypeStatusPropEnum = append(addServiceOkBodyRdsRdsExporterTypeStatusPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyRDSRDSExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsRdsExporterTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyRDSRDSExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"rds_exporter"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + // ContextValidate validate this add service OK body RDS RDS exporter based on the context it is used func (o *AddServiceOKBodyRDSRDSExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -8737,6 +8414,7 @@ func (o *AddServiceOKBodyRDSRDSExporter) ContextValidate(ctx context.Context, fo } func (o *AddServiceOKBodyRDSRDSExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { + if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -8744,15 +8422,11 @@ func (o *AddServiceOKBodyRDSRDSExporter) contextValidateMetricsResolutions(ctx c } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter" + "." + "metrics_resolutions") } - return err } } @@ -8783,6 +8457,7 @@ AddServiceOKBodyRDSRDSExporterMetricsResolutions MetricsResolutions represents P swagger:model AddServiceOKBodyRDSRDSExporterMetricsResolutions */ type AddServiceOKBodyRDSRDSExporterMetricsResolutions struct { + // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -8826,6 +8501,7 @@ AddServiceOKBodyValkey add service OK body valkey swagger:model AddServiceOKBodyValkey */ type AddServiceOKBodyValkey struct { + // service Service *AddServiceOKBodyValkeyService `json:"service,omitempty"` @@ -8858,15 +8534,11 @@ func (o *AddServiceOKBodyValkey) validateService(formats strfmt.Registry) error if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "service") } - return err } } @@ -8881,15 +8553,11 @@ func (o *AddServiceOKBodyValkey) validateValkeyExporter(formats strfmt.Registry) if o.ValkeyExporter != nil { if err := o.ValkeyExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter") } - return err } } @@ -8916,6 +8584,7 @@ func (o *AddServiceOKBodyValkey) ContextValidate(ctx context.Context, formats st } func (o *AddServiceOKBodyValkey) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -8923,15 +8592,11 @@ func (o *AddServiceOKBodyValkey) contextValidateService(ctx context.Context, for } if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "service") } - return err } } @@ -8940,6 +8605,7 @@ func (o *AddServiceOKBodyValkey) contextValidateService(ctx context.Context, for } func (o *AddServiceOKBodyValkey) contextValidateValkeyExporter(ctx context.Context, formats strfmt.Registry) error { + if o.ValkeyExporter != nil { if swag.IsZero(o.ValkeyExporter) { // not required @@ -8947,15 +8613,11 @@ func (o *AddServiceOKBodyValkey) contextValidateValkeyExporter(ctx context.Conte } if err := o.ValkeyExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter") } - return err } } @@ -8986,6 +8648,7 @@ AddServiceOKBodyValkeyService ValkeyService represents a generic Valkey instance swagger:model AddServiceOKBodyValkeyService */ type AddServiceOKBodyValkeyService struct { + // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -9056,6 +8719,7 @@ AddServiceOKBodyValkeyValkeyExporter ValkeyExporter runs on Generic or Container swagger:model AddServiceOKBodyValkeyValkeyExporter */ type AddServiceOKBodyValkeyValkeyExporter struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -9086,18 +8750,6 @@ type AddServiceOKBodyValkeyValkeyExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` @@ -9109,17 +8761,29 @@ type AddServiceOKBodyValkeyValkeyExporter struct { // metrics resolutions MetricsResolutions *AddServiceOKBodyValkeyValkeyExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` } // Validate validates this add service OK body valkey valkey exporter func (o *AddServiceOKBodyValkeyValkeyExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -9129,7 +8793,26 @@ func (o *AddServiceOKBodyValkeyValkeyExporter) Validate(formats strfmt.Registry) return nil } -var addServiceOkBodyValkeyValkeyExporterTypeStatusPropEnum []any +func (o *AddServiceOKBodyValkeyValkeyExporter) validateMetricsResolutions(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsResolutions) { // not required + return nil + } + + if o.MetricsResolutions != nil { + if err := o.MetricsResolutions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter" + "." + "metrics_resolutions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter" + "." + "metrics_resolutions") + } + return err + } + } + + return nil +} + +var addServiceOkBodyValkeyValkeyExporterTypeStatusPropEnum []interface{} func init() { var res []string @@ -9189,29 +8872,6 @@ func (o *AddServiceOKBodyValkeyValkeyExporter) validateStatus(formats strfmt.Reg return nil } -func (o *AddServiceOKBodyValkeyValkeyExporter) validateMetricsResolutions(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsResolutions) { // not required - return nil - } - - if o.MetricsResolutions != nil { - if err := o.MetricsResolutions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - // ContextValidate validate this add service OK body valkey valkey exporter based on the context it is used func (o *AddServiceOKBodyValkeyValkeyExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -9227,6 +8887,7 @@ func (o *AddServiceOKBodyValkeyValkeyExporter) ContextValidate(ctx context.Conte } func (o *AddServiceOKBodyValkeyValkeyExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { + if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -9234,15 +8895,11 @@ func (o *AddServiceOKBodyValkeyValkeyExporter) contextValidateMetricsResolutions } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter" + "." + "metrics_resolutions") } - return err } } @@ -9273,6 +8930,7 @@ AddServiceOKBodyValkeyValkeyExporterMetricsResolutions MetricsResolutions repres swagger:model AddServiceOKBodyValkeyValkeyExporterMetricsResolutions */ type AddServiceOKBodyValkeyValkeyExporterMetricsResolutions struct { + // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -9316,6 +8974,7 @@ AddServiceParamsBodyExternal add service params body external swagger:model AddServiceParamsBodyExternal */ type AddServiceParamsBodyExternal struct { + // Node identifier on which an external exporter is been running. // runs_on_node_id should always be passed with node_id. // Exactly one of these parameters should be present: node_id, node_name, add_node. @@ -9366,13 +9025,6 @@ type AddServiceParamsBodyExternal struct { // Group name of external service. Group string `json:"group,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` - // Skip connection check. SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` @@ -9381,17 +9033,24 @@ type AddServiceParamsBodyExternal struct { // add node AddNode *AddServiceParamsBodyExternalAddNode `json:"add_node,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body external func (o *AddServiceParamsBodyExternal) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -9401,7 +9060,26 @@ func (o *AddServiceParamsBodyExternal) Validate(formats strfmt.Registry) error { return nil } -var addServiceParamsBodyExternalTypeMetricsModePropEnum []any +func (o *AddServiceParamsBodyExternal) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required + return nil + } + + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "external" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "external" + "." + "add_node") + } + return err + } + } + + return nil +} + +var addServiceParamsBodyExternalTypeMetricsModePropEnum []interface{} func init() { var res []string @@ -9446,29 +9124,6 @@ func (o *AddServiceParamsBodyExternal) validateMetricsMode(formats strfmt.Regist return nil } -func (o *AddServiceParamsBodyExternal) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required - return nil - } - - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "external" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "external" + "." + "add_node") - } - - return err - } - } - - return nil -} - // ContextValidate validate this add service params body external based on the context it is used func (o *AddServiceParamsBodyExternal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -9484,6 +9139,7 @@ func (o *AddServiceParamsBodyExternal) ContextValidate(ctx context.Context, form } func (o *AddServiceParamsBodyExternal) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { + if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -9491,15 +9147,11 @@ func (o *AddServiceParamsBodyExternal) contextValidateAddNode(ctx context.Contex } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "external" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "external" + "." + "add_node") } - return err } } @@ -9530,9 +9182,6 @@ AddServiceParamsBodyExternalAddNode AddNodeParams holds node params and is used swagger:model AddServiceParamsBodyExternalAddNode */ type AddServiceParamsBodyExternalAddNode struct { - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -9560,6 +9209,10 @@ type AddServiceParamsBodyExternalAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body external add node @@ -9576,7 +9229,7 @@ func (o *AddServiceParamsBodyExternalAddNode) Validate(formats strfmt.Registry) return nil } -var addServiceParamsBodyExternalAddNodeTypeNodeTypePropEnum []any +var addServiceParamsBodyExternalAddNodeTypeNodeTypePropEnum []interface{} func init() { var res []string @@ -9658,6 +9311,7 @@ AddServiceParamsBodyHaproxy add service params body haproxy swagger:model AddServiceParamsBodyHaproxy */ type AddServiceParamsBodyHaproxy struct { + // Node identifier on which an external exporter is been running. // Exactly one of these parameters should be present: node_id, node_name, add_node. NodeID string `json:"node_id,omitempty"` @@ -9698,14 +9352,7 @@ type AddServiceParamsBodyHaproxy struct { ReplicationSet string `json:"replication_set,omitempty"` // Custom user-assigned labels for Service. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` + CustomLabels map[string]string `json:"custom_labels,omitempty"` // Skip connection check. SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` @@ -9715,17 +9362,24 @@ type AddServiceParamsBodyHaproxy struct { // add node AddNode *AddServiceParamsBodyHaproxyAddNode `json:"add_node,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body haproxy func (o *AddServiceParamsBodyHaproxy) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -9735,7 +9389,26 @@ func (o *AddServiceParamsBodyHaproxy) Validate(formats strfmt.Registry) error { return nil } -var addServiceParamsBodyHaproxyTypeMetricsModePropEnum []any +func (o *AddServiceParamsBodyHaproxy) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required + return nil + } + + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "haproxy" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "haproxy" + "." + "add_node") + } + return err + } + } + + return nil +} + +var addServiceParamsBodyHaproxyTypeMetricsModePropEnum []interface{} func init() { var res []string @@ -9780,29 +9453,6 @@ func (o *AddServiceParamsBodyHaproxy) validateMetricsMode(formats strfmt.Registr return nil } -func (o *AddServiceParamsBodyHaproxy) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required - return nil - } - - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "haproxy" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "haproxy" + "." + "add_node") - } - - return err - } - } - - return nil -} - // ContextValidate validate this add service params body haproxy based on the context it is used func (o *AddServiceParamsBodyHaproxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -9818,6 +9468,7 @@ func (o *AddServiceParamsBodyHaproxy) ContextValidate(ctx context.Context, forma } func (o *AddServiceParamsBodyHaproxy) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { + if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -9825,15 +9476,11 @@ func (o *AddServiceParamsBodyHaproxy) contextValidateAddNode(ctx context.Context } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "haproxy" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "haproxy" + "." + "add_node") } - return err } } @@ -9864,9 +9511,6 @@ AddServiceParamsBodyHaproxyAddNode AddNodeParams holds node params and is used t swagger:model AddServiceParamsBodyHaproxyAddNode */ type AddServiceParamsBodyHaproxyAddNode struct { - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -9894,6 +9538,10 @@ type AddServiceParamsBodyHaproxyAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body haproxy add node @@ -9910,7 +9558,7 @@ func (o *AddServiceParamsBodyHaproxyAddNode) Validate(formats strfmt.Registry) e return nil } -var addServiceParamsBodyHaproxyAddNodeTypeNodeTypePropEnum []any +var addServiceParamsBodyHaproxyAddNodeTypeNodeTypePropEnum []interface{} func init() { var res []string @@ -9992,6 +9640,7 @@ AddServiceParamsBodyMongodb add service params body mongodb swagger:model AddServiceParamsBodyMongodb */ type AddServiceParamsBodyMongodb struct { + // Node identifier on which a service is been running. // Exactly one of these parameters should be present: node_id, node_name, add_node. NodeID string `json:"node_id,omitempty"` @@ -10063,13 +9712,6 @@ type AddServiceParamsBodyMongodb struct { // Limit query length in QAN (default: server-defined; -1: no limit). MaxQueryLength int32 `json:"max_query_length,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` @@ -10094,12 +9736,6 @@ type AddServiceParamsBodyMongodb struct { // Enable all collectors EnableAllCollectors bool `json:"enable_all_collectors,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces ExposeExporter bool `json:"expose_exporter,omitempty"` @@ -10112,13 +9748,26 @@ type AddServiceParamsBodyMongodb struct { // add node AddNode *AddServiceParamsBodyMongodbAddNode `json:"add_node,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body mongodb func (o *AddServiceParamsBodyMongodb) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } @@ -10126,7 +9775,7 @@ func (o *AddServiceParamsBodyMongodb) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -10136,52 +9785,26 @@ func (o *AddServiceParamsBodyMongodb) Validate(formats strfmt.Registry) error { return nil } -var addServiceParamsBodyMongodbTypeMetricsModePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceParamsBodyMongodbTypeMetricsModePropEnum = append(addServiceParamsBodyMongodbTypeMetricsModePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyMongodbMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - AddServiceParamsBodyMongodbMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - - // AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - - // AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) - -// prop value enum -func (o *AddServiceParamsBodyMongodb) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyMongodbTypeMetricsModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyMongodb) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required +func (o *AddServiceParamsBodyMongodb) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required return nil } - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"mongodb"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "mongodb" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "mongodb" + "." + "add_node") + } + return err + } } return nil } -var addServiceParamsBodyMongodbTypeLogLevelPropEnum []any +var addServiceParamsBodyMongodbTypeLogLevelPropEnum []interface{} func init() { var res []string @@ -10235,24 +9858,46 @@ func (o *AddServiceParamsBodyMongodb) validateLogLevel(formats strfmt.Registry) return nil } -func (o *AddServiceParamsBodyMongodb) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required - return nil +var addServiceParamsBodyMongodbTypeMetricsModePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceParamsBodyMongodbTypeMetricsModePropEnum = append(addServiceParamsBodyMongodbTypeMetricsModePropEnum, v) } +} - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb" + "." + "add_node") - } +const ( - return err - } + // AddServiceParamsBodyMongodbMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" + AddServiceParamsBodyMongodbMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" + + // AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" + AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" + + // AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" + AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" +) + +// prop value enum +func (o *AddServiceParamsBodyMongodb) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceParamsBodyMongodbTypeMetricsModePropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceParamsBodyMongodb) validateMetricsMode(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsMode) { // not required + return nil + } + + // value enum + if err := o.validateMetricsModeEnum("body"+"."+"mongodb"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + return err } return nil @@ -10273,6 +9918,7 @@ func (o *AddServiceParamsBodyMongodb) ContextValidate(ctx context.Context, forma } func (o *AddServiceParamsBodyMongodb) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { + if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -10280,15 +9926,11 @@ func (o *AddServiceParamsBodyMongodb) contextValidateAddNode(ctx context.Context } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "mongodb" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "mongodb" + "." + "add_node") } - return err } } @@ -10319,9 +9961,6 @@ AddServiceParamsBodyMongodbAddNode AddNodeParams holds node params and is used t swagger:model AddServiceParamsBodyMongodbAddNode */ type AddServiceParamsBodyMongodbAddNode struct { - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -10349,6 +9988,10 @@ type AddServiceParamsBodyMongodbAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body mongodb add node @@ -10365,7 +10008,7 @@ func (o *AddServiceParamsBodyMongodbAddNode) Validate(formats strfmt.Registry) e return nil } -var addServiceParamsBodyMongodbAddNodeTypeNodeTypePropEnum []any +var addServiceParamsBodyMongodbAddNodeTypeNodeTypePropEnum []interface{} func init() { var res []string @@ -10447,6 +10090,7 @@ AddServiceParamsBodyMysql add service params body mysql swagger:model AddServiceParamsBodyMysql */ type AddServiceParamsBodyMysql struct { + // Node identifier on which a service is been running. // Exactly one of these parameters should be present: node_id, node_name, add_node. NodeID string `json:"node_id,omitempty"` @@ -10534,25 +10178,12 @@ type AddServiceParamsBodyMysql struct { // Use negative value to disable them. TablestatsGroupTableLimit int32 `json:"tablestats_group_table_limit,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` // Custom password for exporter endpoint /metrics. AgentPassword string `json:"agent_password,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces ExposeExporter bool `json:"expose_exporter,omitempty"` @@ -10561,13 +10192,26 @@ type AddServiceParamsBodyMysql struct { // add node AddNode *AddServiceParamsBodyMysqlAddNode `json:"add_node,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body mysql func (o *AddServiceParamsBodyMysql) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } @@ -10575,7 +10219,7 @@ func (o *AddServiceParamsBodyMysql) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -10584,53 +10228,27 @@ func (o *AddServiceParamsBodyMysql) Validate(formats strfmt.Registry) error { } return nil } - -var addServiceParamsBodyMysqlTypeMetricsModePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceParamsBodyMysqlTypeMetricsModePropEnum = append(addServiceParamsBodyMysqlTypeMetricsModePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyMysqlMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - AddServiceParamsBodyMysqlMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - - // AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - - // AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) - -// prop value enum -func (o *AddServiceParamsBodyMysql) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyMysqlTypeMetricsModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyMysql) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required + +func (o *AddServiceParamsBodyMysql) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required return nil } - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"mysql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "mysql" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "mysql" + "." + "add_node") + } + return err + } } return nil } -var addServiceParamsBodyMysqlTypeLogLevelPropEnum []any +var addServiceParamsBodyMysqlTypeLogLevelPropEnum []interface{} func init() { var res []string @@ -10684,24 +10302,46 @@ func (o *AddServiceParamsBodyMysql) validateLogLevel(formats strfmt.Registry) er return nil } -func (o *AddServiceParamsBodyMysql) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required - return nil +var addServiceParamsBodyMysqlTypeMetricsModePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceParamsBodyMysqlTypeMetricsModePropEnum = append(addServiceParamsBodyMysqlTypeMetricsModePropEnum, v) } +} - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql" + "." + "add_node") - } +const ( - return err - } + // AddServiceParamsBodyMysqlMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" + AddServiceParamsBodyMysqlMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" + + // AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" + AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" + + // AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" + AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" +) + +// prop value enum +func (o *AddServiceParamsBodyMysql) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceParamsBodyMysqlTypeMetricsModePropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceParamsBodyMysql) validateMetricsMode(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsMode) { // not required + return nil + } + + // value enum + if err := o.validateMetricsModeEnum("body"+"."+"mysql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + return err } return nil @@ -10722,6 +10362,7 @@ func (o *AddServiceParamsBodyMysql) ContextValidate(ctx context.Context, formats } func (o *AddServiceParamsBodyMysql) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { + if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -10729,15 +10370,11 @@ func (o *AddServiceParamsBodyMysql) contextValidateAddNode(ctx context.Context, } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "mysql" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "mysql" + "." + "add_node") } - return err } } @@ -10768,9 +10405,6 @@ AddServiceParamsBodyMysqlAddNode AddNodeParams holds node params and is used to swagger:model AddServiceParamsBodyMysqlAddNode */ type AddServiceParamsBodyMysqlAddNode struct { - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -10798,6 +10432,10 @@ type AddServiceParamsBodyMysqlAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body mysql add node @@ -10814,7 +10452,7 @@ func (o *AddServiceParamsBodyMysqlAddNode) Validate(formats strfmt.Registry) err return nil } -var addServiceParamsBodyMysqlAddNodeTypeNodeTypePropEnum []any +var addServiceParamsBodyMysqlAddNodeTypeNodeTypePropEnum []interface{} func init() { var res []string @@ -10896,6 +10534,7 @@ AddServiceParamsBodyPostgresql add service params body postgresql swagger:model AddServiceParamsBodyPostgresql */ type AddServiceParamsBodyPostgresql struct { + // Node identifier on which a service is been running. // Exactly one of these parameters should be present: node_id, node_name, add_node. NodeID string `json:"node_id,omitempty"` @@ -10967,13 +10606,6 @@ type AddServiceParamsBodyPostgresql struct { // Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full. TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` @@ -10989,12 +10621,6 @@ type AddServiceParamsBodyPostgresql struct { // Custom password for exporter endpoint /metrics. AgentPassword string `json:"agent_password,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // Limit for auto discovery. AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` @@ -11006,13 +10632,26 @@ type AddServiceParamsBodyPostgresql struct { // add node AddNode *AddServiceParamsBodyPostgresqlAddNode `json:"add_node,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body postgresql func (o *AddServiceParamsBodyPostgresql) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } @@ -11020,7 +10659,7 @@ func (o *AddServiceParamsBodyPostgresql) Validate(formats strfmt.Registry) error res = append(res, err) } - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -11030,52 +10669,26 @@ func (o *AddServiceParamsBodyPostgresql) Validate(formats strfmt.Registry) error return nil } -var addServiceParamsBodyPostgresqlTypeMetricsModePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceParamsBodyPostgresqlTypeMetricsModePropEnum = append(addServiceParamsBodyPostgresqlTypeMetricsModePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - - // AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - - // AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) - -// prop value enum -func (o *AddServiceParamsBodyPostgresql) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyPostgresqlTypeMetricsModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyPostgresql) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required +func (o *AddServiceParamsBodyPostgresql) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required return nil } - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"postgresql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "postgresql" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "postgresql" + "." + "add_node") + } + return err + } } return nil } -var addServiceParamsBodyPostgresqlTypeLogLevelPropEnum []any +var addServiceParamsBodyPostgresqlTypeLogLevelPropEnum []interface{} func init() { var res []string @@ -11129,24 +10742,46 @@ func (o *AddServiceParamsBodyPostgresql) validateLogLevel(formats strfmt.Registr return nil } -func (o *AddServiceParamsBodyPostgresql) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required - return nil +var addServiceParamsBodyPostgresqlTypeMetricsModePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceParamsBodyPostgresqlTypeMetricsModePropEnum = append(addServiceParamsBodyPostgresqlTypeMetricsModePropEnum, v) } +} - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgresql" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgresql" + "." + "add_node") - } +const ( - return err - } + // AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" + AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" + + // AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" + AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" + + // AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" + AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" +) + +// prop value enum +func (o *AddServiceParamsBodyPostgresql) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceParamsBodyPostgresqlTypeMetricsModePropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceParamsBodyPostgresql) validateMetricsMode(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsMode) { // not required + return nil + } + + // value enum + if err := o.validateMetricsModeEnum("body"+"."+"postgresql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + return err } return nil @@ -11167,6 +10802,7 @@ func (o *AddServiceParamsBodyPostgresql) ContextValidate(ctx context.Context, fo } func (o *AddServiceParamsBodyPostgresql) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { + if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -11174,15 +10810,11 @@ func (o *AddServiceParamsBodyPostgresql) contextValidateAddNode(ctx context.Cont } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "postgresql" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "postgresql" + "." + "add_node") } - return err } } @@ -11213,9 +10845,6 @@ AddServiceParamsBodyPostgresqlAddNode AddNodeParams holds node params and is use swagger:model AddServiceParamsBodyPostgresqlAddNode */ type AddServiceParamsBodyPostgresqlAddNode struct { - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -11243,6 +10872,10 @@ type AddServiceParamsBodyPostgresqlAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body postgresql add node @@ -11259,7 +10892,7 @@ func (o *AddServiceParamsBodyPostgresqlAddNode) Validate(formats strfmt.Registry return nil } -var addServiceParamsBodyPostgresqlAddNodeTypeNodeTypePropEnum []any +var addServiceParamsBodyPostgresqlAddNodeTypeNodeTypePropEnum []interface{} func init() { var res []string @@ -11341,6 +10974,7 @@ AddServiceParamsBodyProxysql add service params body proxysql swagger:model AddServiceParamsBodyProxysql */ type AddServiceParamsBodyProxysql struct { + // Node identifier on which a service is been running. // Exactly one of these parameters should be present: node_id, node_name, add_node. NodeID string `json:"node_id,omitempty"` @@ -11394,100 +11028,74 @@ type AddServiceParamsBodyProxysql struct { // Skip TLS certificate and hostname validation. TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` // Custom password for exporter endpoint /metrics. AgentPassword string `json:"agent_password,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces ExposeExporter bool `json:"expose_exporter,omitempty"` // add node AddNode *AddServiceParamsBodyProxysqlAddNode `json:"add_node,omitempty"` -} - -// Validate validates this add service params body proxysql -func (o *AddServiceParamsBodyProxysql) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMetricsMode(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if err := o.validateAddNode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} -var addServiceParamsBodyProxysqlTypeMetricsModePropEnum []any + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` -func init() { - var res []string - if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceParamsBodyProxysqlTypeMetricsModePropEnum = append(addServiceParamsBodyProxysqlTypeMetricsModePropEnum, v) - } + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` } -const ( +// Validate validates this add service params body proxysql +func (o *AddServiceParamsBodyProxysql) Validate(formats strfmt.Registry) error { + var res []error - // AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" + if err := o.validateAddNode(formats); err != nil { + res = append(res, err) + } - // AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" + if err := o.validateLogLevel(formats); err != nil { + res = append(res, err) + } - // AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) + if err := o.validateMetricsMode(formats); err != nil { + res = append(res, err) + } -// prop value enum -func (o *AddServiceParamsBodyProxysql) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyProxysqlTypeMetricsModePropEnum, true); err != nil { - return err + if len(res) > 0 { + return errors.CompositeValidationError(res...) } return nil } -func (o *AddServiceParamsBodyProxysql) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required +func (o *AddServiceParamsBodyProxysql) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required return nil } - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"proxysql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "proxysql" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "proxysql" + "." + "add_node") + } + return err + } } return nil } -var addServiceParamsBodyProxysqlTypeLogLevelPropEnum []any +var addServiceParamsBodyProxysqlTypeLogLevelPropEnum []interface{} func init() { var res []string @@ -11541,24 +11149,46 @@ func (o *AddServiceParamsBodyProxysql) validateLogLevel(formats strfmt.Registry) return nil } -func (o *AddServiceParamsBodyProxysql) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required - return nil +var addServiceParamsBodyProxysqlTypeMetricsModePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceParamsBodyProxysqlTypeMetricsModePropEnum = append(addServiceParamsBodyProxysqlTypeMetricsModePropEnum, v) } +} - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "proxysql" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql" + "." + "add_node") - } +const ( - return err - } + // AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" + AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" + + // AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" + AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" + + // AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" + AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" +) + +// prop value enum +func (o *AddServiceParamsBodyProxysql) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceParamsBodyProxysqlTypeMetricsModePropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceParamsBodyProxysql) validateMetricsMode(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsMode) { // not required + return nil + } + + // value enum + if err := o.validateMetricsModeEnum("body"+"."+"proxysql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + return err } return nil @@ -11579,6 +11209,7 @@ func (o *AddServiceParamsBodyProxysql) ContextValidate(ctx context.Context, form } func (o *AddServiceParamsBodyProxysql) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { + if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -11586,15 +11217,11 @@ func (o *AddServiceParamsBodyProxysql) contextValidateAddNode(ctx context.Contex } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "proxysql" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "proxysql" + "." + "add_node") } - return err } } @@ -11625,9 +11252,6 @@ AddServiceParamsBodyProxysqlAddNode AddNodeParams holds node params and is used swagger:model AddServiceParamsBodyProxysqlAddNode */ type AddServiceParamsBodyProxysqlAddNode struct { - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -11655,6 +11279,10 @@ type AddServiceParamsBodyProxysqlAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body proxysql add node @@ -11671,7 +11299,7 @@ func (o *AddServiceParamsBodyProxysqlAddNode) Validate(formats strfmt.Registry) return nil } -var addServiceParamsBodyProxysqlAddNodeTypeNodeTypePropEnum []any +var addServiceParamsBodyProxysqlAddNodeTypeNodeTypePropEnum []interface{} func init() { var res []string @@ -11753,6 +11381,7 @@ AddServiceParamsBodyRDS add service params body RDS swagger:model AddServiceParamsBodyRDS */ type AddServiceParamsBodyRDS struct { + // AWS region. Region string `json:"region,omitempty"` @@ -11771,10 +11400,6 @@ type AddServiceParamsBodyRDS struct { // Access port. Port int64 `json:"port,omitempty"` - // DiscoverRDSEngine describes supported RDS instance engines. - // Enum: ["DISCOVER_RDS_ENGINE_UNSPECIFIED","DISCOVER_RDS_ENGINE_MYSQL","DISCOVER_RDS_ENGINE_POSTGRESQL"] - Engine *string `json:"engine,omitempty"` - // PMM Agent ID. PMMAgentID string `json:"pmm_agent_id,omitempty"` @@ -11837,13 +11462,6 @@ type AddServiceParamsBodyRDS struct { // Disable enhanced metrics. DisableEnhancedMetrics bool `json:"disable_enhanced_metrics,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` - // If true, add qan-pgstatements QANPostgresqlPgstatements bool `json:"qan_postgresql_pgstatements,omitempty"` @@ -11861,6 +11479,17 @@ type AddServiceParamsBodyRDS struct { // Maximum number of exporter connections to PostgreSQL instance. MaxPostgresqlExporterConnections int32 `json:"max_postgresql_exporter_connections,omitempty"` + + // DiscoverRDSEngine describes supported RDS instance engines. + // Enum: ["DISCOVER_RDS_ENGINE_UNSPECIFIED","DISCOVER_RDS_ENGINE_MYSQL","DISCOVER_RDS_ENGINE_POSTGRESQL"] + Engine *string `json:"engine,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body RDS @@ -11881,7 +11510,7 @@ func (o *AddServiceParamsBodyRDS) Validate(formats strfmt.Registry) error { return nil } -var addServiceParamsBodyRdsTypeEnginePropEnum []any +var addServiceParamsBodyRdsTypeEnginePropEnum []interface{} func init() { var res []string @@ -11926,7 +11555,7 @@ func (o *AddServiceParamsBodyRDS) validateEngine(formats strfmt.Registry) error return nil } -var addServiceParamsBodyRdsTypeMetricsModePropEnum []any +var addServiceParamsBodyRdsTypeMetricsModePropEnum []interface{} func init() { var res []string @@ -11999,6 +11628,7 @@ AddServiceParamsBodyValkey add service params body valkey swagger:model AddServiceParamsBodyValkey */ type AddServiceParamsBodyValkey struct { + // Node identifier on which the service is running. // Only one of these parameters should be present: node_id, node_name, add_node. NodeID string `json:"node_id,omitempty"` @@ -12052,19 +11682,6 @@ type AddServiceParamsBodyValkey struct { // Skip TLS verification. TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces ExposeExporter bool `json:"expose_exporter,omitempty"` @@ -12082,13 +11699,26 @@ type AddServiceParamsBodyValkey struct { // add node AddNode *AddServiceParamsBodyValkeyAddNode `json:"add_node,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body valkey func (o *AddServiceParamsBodyValkey) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } @@ -12096,7 +11726,7 @@ func (o *AddServiceParamsBodyValkey) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -12106,52 +11736,26 @@ func (o *AddServiceParamsBodyValkey) Validate(formats strfmt.Registry) error { return nil } -var addServiceParamsBodyValkeyTypeMetricsModePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceParamsBodyValkeyTypeMetricsModePropEnum = append(addServiceParamsBodyValkeyTypeMetricsModePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyValkeyMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - AddServiceParamsBodyValkeyMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - - // AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - - // AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) - -// prop value enum -func (o *AddServiceParamsBodyValkey) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyValkeyTypeMetricsModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyValkey) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required +func (o *AddServiceParamsBodyValkey) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required return nil } - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"valkey"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "valkey" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "valkey" + "." + "add_node") + } + return err + } } return nil } -var addServiceParamsBodyValkeyTypeLogLevelPropEnum []any +var addServiceParamsBodyValkeyTypeLogLevelPropEnum []interface{} func init() { var res []string @@ -12205,24 +11809,46 @@ func (o *AddServiceParamsBodyValkey) validateLogLevel(formats strfmt.Registry) e return nil } -func (o *AddServiceParamsBodyValkey) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required - return nil +var addServiceParamsBodyValkeyTypeMetricsModePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceParamsBodyValkeyTypeMetricsModePropEnum = append(addServiceParamsBodyValkeyTypeMetricsModePropEnum, v) } +} - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "valkey" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey" + "." + "add_node") - } +const ( - return err - } + // AddServiceParamsBodyValkeyMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" + AddServiceParamsBodyValkeyMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" + + // AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" + AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" + + // AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" + AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" +) + +// prop value enum +func (o *AddServiceParamsBodyValkey) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceParamsBodyValkeyTypeMetricsModePropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceParamsBodyValkey) validateMetricsMode(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsMode) { // not required + return nil + } + + // value enum + if err := o.validateMetricsModeEnum("body"+"."+"valkey"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + return err } return nil @@ -12243,6 +11869,7 @@ func (o *AddServiceParamsBodyValkey) ContextValidate(ctx context.Context, format } func (o *AddServiceParamsBodyValkey) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { + if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -12250,15 +11877,11 @@ func (o *AddServiceParamsBodyValkey) contextValidateAddNode(ctx context.Context, } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "valkey" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("body" + "." + "valkey" + "." + "add_node") } - return err } } @@ -12289,9 +11912,6 @@ AddServiceParamsBodyValkeyAddNode AddNodeParams holds node params and is used to swagger:model AddServiceParamsBodyValkeyAddNode */ type AddServiceParamsBodyValkeyAddNode struct { - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -12319,6 +11939,10 @@ type AddServiceParamsBodyValkeyAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body valkey add node @@ -12335,7 +11959,7 @@ func (o *AddServiceParamsBodyValkeyAddNode) Validate(formats strfmt.Registry) er return nil } -var addServiceParamsBodyValkeyAddNodeTypeNodeTypePropEnum []any +var addServiceParamsBodyValkeyAddNodeTypeNodeTypePropEnum []interface{} func init() { var res []string diff --git a/api/management/v1/json/client/management_service/create_node_install_token_parameters.go b/api/management/v1/json/client/management_service/create_node_install_token_parameters.go new file mode 100644 index 00000000000..e9581d24fde --- /dev/null +++ b/api/management/v1/json/client/management_service/create_node_install_token_parameters.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package management_service + +// 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" +) + +// NewCreateNodeInstallTokenParams creates a new CreateNodeInstallTokenParams 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 NewCreateNodeInstallTokenParams() *CreateNodeInstallTokenParams { + return &CreateNodeInstallTokenParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateNodeInstallTokenParamsWithTimeout creates a new CreateNodeInstallTokenParams object +// with the ability to set a timeout on a request. +func NewCreateNodeInstallTokenParamsWithTimeout(timeout time.Duration) *CreateNodeInstallTokenParams { + return &CreateNodeInstallTokenParams{ + timeout: timeout, + } +} + +// NewCreateNodeInstallTokenParamsWithContext creates a new CreateNodeInstallTokenParams object +// with the ability to set a context for a request. +func NewCreateNodeInstallTokenParamsWithContext(ctx context.Context) *CreateNodeInstallTokenParams { + return &CreateNodeInstallTokenParams{ + Context: ctx, + } +} + +// NewCreateNodeInstallTokenParamsWithHTTPClient creates a new CreateNodeInstallTokenParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateNodeInstallTokenParamsWithHTTPClient(client *http.Client) *CreateNodeInstallTokenParams { + return &CreateNodeInstallTokenParams{ + HTTPClient: client, + } +} + +/* +CreateNodeInstallTokenParams contains all the parameters to send to the API endpoint + + for the create node install token operation. + + Typically these are written to a http.Request. +*/ +type CreateNodeInstallTokenParams struct { + + /* Body. + + CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash). + */ + Body CreateNodeInstallTokenBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create node install token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNodeInstallTokenParams) WithDefaults() *CreateNodeInstallTokenParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create node install token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNodeInstallTokenParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create node install token params +func (o *CreateNodeInstallTokenParams) WithTimeout(timeout time.Duration) *CreateNodeInstallTokenParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create node install token params +func (o *CreateNodeInstallTokenParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create node install token params +func (o *CreateNodeInstallTokenParams) WithContext(ctx context.Context) *CreateNodeInstallTokenParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create node install token params +func (o *CreateNodeInstallTokenParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create node install token params +func (o *CreateNodeInstallTokenParams) WithHTTPClient(client *http.Client) *CreateNodeInstallTokenParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create node install token params +func (o *CreateNodeInstallTokenParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create node install token params +func (o *CreateNodeInstallTokenParams) WithBody(body CreateNodeInstallTokenBody) *CreateNodeInstallTokenParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create node install token params +func (o *CreateNodeInstallTokenParams) SetBody(body CreateNodeInstallTokenBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateNodeInstallTokenParams) 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/management/v1/json/client/management_service/create_node_install_token_responses.go b/api/management/v1/json/client/management_service/create_node_install_token_responses.go new file mode 100644 index 00000000000..a20e2b7e4c3 --- /dev/null +++ b/api/management/v1/json/client/management_service/create_node_install_token_responses.go @@ -0,0 +1,524 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package management_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateNodeInstallTokenReader is a Reader for the CreateNodeInstallToken structure. +type CreateNodeInstallTokenReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateNodeInstallTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateNodeInstallTokenOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCreateNodeInstallTokenDefault(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 + } +} + +// NewCreateNodeInstallTokenOK creates a CreateNodeInstallTokenOK with default headers values +func NewCreateNodeInstallTokenOK() *CreateNodeInstallTokenOK { + return &CreateNodeInstallTokenOK{} +} + +/* +CreateNodeInstallTokenOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type CreateNodeInstallTokenOK struct { + Payload *CreateNodeInstallTokenOKBody +} + +// IsSuccess returns true when this create node install token Ok response has a 2xx status code +func (o *CreateNodeInstallTokenOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create node install token Ok response has a 3xx status code +func (o *CreateNodeInstallTokenOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create node install token Ok response has a 4xx status code +func (o *CreateNodeInstallTokenOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create node install token Ok response has a 5xx status code +func (o *CreateNodeInstallTokenOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create node install token Ok response a status code equal to that given +func (o *CreateNodeInstallTokenOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create node install token Ok response +func (o *CreateNodeInstallTokenOK) Code() int { + return 200 +} + +func (o *CreateNodeInstallTokenOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/management/nodes:installToken][%d] createNodeInstallTokenOk %s", 200, payload) +} + +func (o *CreateNodeInstallTokenOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/management/nodes:installToken][%d] createNodeInstallTokenOk %s", 200, payload) +} + +func (o *CreateNodeInstallTokenOK) GetPayload() *CreateNodeInstallTokenOKBody { + return o.Payload +} + +func (o *CreateNodeInstallTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(CreateNodeInstallTokenOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateNodeInstallTokenDefault creates a CreateNodeInstallTokenDefault with default headers values +func NewCreateNodeInstallTokenDefault(code int) *CreateNodeInstallTokenDefault { + return &CreateNodeInstallTokenDefault{ + _statusCode: code, + } +} + +/* +CreateNodeInstallTokenDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type CreateNodeInstallTokenDefault struct { + _statusCode int + + Payload *CreateNodeInstallTokenDefaultBody +} + +// IsSuccess returns true when this create node install token default response has a 2xx status code +func (o *CreateNodeInstallTokenDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this create node install token default response has a 3xx status code +func (o *CreateNodeInstallTokenDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this create node install token default response has a 4xx status code +func (o *CreateNodeInstallTokenDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this create node install token default response has a 5xx status code +func (o *CreateNodeInstallTokenDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this create node install token default response a status code equal to that given +func (o *CreateNodeInstallTokenDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the create node install token default response +func (o *CreateNodeInstallTokenDefault) Code() int { + return o._statusCode +} + +func (o *CreateNodeInstallTokenDefault) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/management/nodes:installToken][%d] CreateNodeInstallToken default %s", o._statusCode, payload) +} + +func (o *CreateNodeInstallTokenDefault) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/management/nodes:installToken][%d] CreateNodeInstallToken default %s", o._statusCode, payload) +} + +func (o *CreateNodeInstallTokenDefault) GetPayload() *CreateNodeInstallTokenDefaultBody { + return o.Payload +} + +func (o *CreateNodeInstallTokenDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(CreateNodeInstallTokenDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/* +CreateNodeInstallTokenBody CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash). +swagger:model CreateNodeInstallTokenBody +*/ +type CreateNodeInstallTokenBody struct { + + // Token TTL in seconds; 0 means use server default. Server clamps to a maximum. + TTLSeconds int64 `json:"ttl_seconds,omitempty"` + + // Technology for install script TECH env (e.g. mysql, postgresql, mongodb). + Technology string `json:"technology,omitempty"` +} + +// Validate validates this create node install token body +func (o *CreateNodeInstallTokenBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this create node install token body based on context it is used +func (o *CreateNodeInstallTokenBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *CreateNodeInstallTokenBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *CreateNodeInstallTokenBody) UnmarshalBinary(b []byte) error { + var res CreateNodeInstallTokenBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +CreateNodeInstallTokenDefaultBody create node install token default body +swagger:model CreateNodeInstallTokenDefaultBody +*/ +type CreateNodeInstallTokenDefaultBody struct { + + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*CreateNodeInstallTokenDefaultBodyDetailsItems0 `json:"details"` +} + +// Validate validates this create node install token default body +func (o *CreateNodeInstallTokenDefaultBody) 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 *CreateNodeInstallTokenDefaultBody) 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("CreateNodeInstallToken default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CreateNodeInstallToken default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create node install token default body based on the context it is used +func (o *CreateNodeInstallTokenDefaultBody) 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 *CreateNodeInstallTokenDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + + if swag.IsZero(o.Details[i]) { // not required + return nil + } + + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CreateNodeInstallToken default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CreateNodeInstallToken default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *CreateNodeInstallTokenDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *CreateNodeInstallTokenDefaultBody) UnmarshalBinary(b []byte) error { + var res CreateNodeInstallTokenDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +CreateNodeInstallTokenDefaultBodyDetailsItems0 create node install token default body details items0 +swagger:model CreateNodeInstallTokenDefaultBodyDetailsItems0 +*/ +type CreateNodeInstallTokenDefaultBodyDetailsItems0 struct { + + // at type + AtType string `json:"@type,omitempty"` + + // create node install token default body details items0 + CreateNodeInstallTokenDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` +} + +// UnmarshalJSON unmarshals this object with additional properties from JSON +func (o *CreateNodeInstallTokenDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { + // stage 1, bind the properties + var stage1 struct { + + // at type + AtType string `json:"@type,omitempty"` + } + if err := json.Unmarshal(data, &stage1); err != nil { + return err + } + var rcv CreateNodeInstallTokenDefaultBodyDetailsItems0 + + rcv.AtType = stage1.AtType + *o = rcv + + // stage 2, remove properties and add to map + stage2 := make(map[string]json.RawMessage) + if err := json.Unmarshal(data, &stage2); err != nil { + return err + } + + delete(stage2, "@type") + // stage 3, add additional properties values + if len(stage2) > 0 { + result := make(map[string]interface{}) + for k, v := range stage2 { + var toadd interface{} + if err := json.Unmarshal(v, &toadd); err != nil { + return err + } + result[k] = toadd + } + o.CreateNodeInstallTokenDefaultBodyDetailsItems0 = result + } + + return nil +} + +// MarshalJSON marshals this object with additional properties into a JSON object +func (o CreateNodeInstallTokenDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { + var stage1 struct { + + // at type + AtType string `json:"@type,omitempty"` + } + + stage1.AtType = o.AtType + + // make JSON object for known properties + props, err := json.Marshal(stage1) + if err != nil { + return nil, err + } + + if len(o.CreateNodeInstallTokenDefaultBodyDetailsItems0) == 0 { // no additional properties + return props, nil + } + + // make JSON object for the additional properties + additional, err := json.Marshal(o.CreateNodeInstallTokenDefaultBodyDetailsItems0) + if err != nil { + return nil, err + } + + if len(props) < 3 { // "{}": only additional properties + return additional, nil + } + + // concatenate the 2 objects + return swag.ConcatJSON(props, additional), nil +} + +// Validate validates this create node install token default body details items0 +func (o *CreateNodeInstallTokenDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this create node install token default body details items0 based on context it is used +func (o *CreateNodeInstallTokenDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *CreateNodeInstallTokenDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *CreateNodeInstallTokenDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res CreateNodeInstallTokenDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +CreateNodeInstallTokenOKBody CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL. +swagger:model CreateNodeInstallTokenOKBody +*/ +type CreateNodeInstallTokenOKBody struct { + + // Plaintext token for PMM_SERVER_URL userinfo (service_token:). + Token string `json:"token,omitempty"` + + // Expiration time of the token (derived from TTL). + // Format: date-time + ExpiresAt strfmt.DateTime `json:"expires_at,omitempty"` + + // Grafana service account id created for this install token flow. + ServiceAccountID string `json:"service_account_id,omitempty"` +} + +// Validate validates this create node install token OK body +func (o *CreateNodeInstallTokenOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateExpiresAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CreateNodeInstallTokenOKBody) validateExpiresAt(formats strfmt.Registry) error { + if swag.IsZero(o.ExpiresAt) { // not required + return nil + } + + if err := validate.FormatOf("createNodeInstallTokenOk"+"."+"expires_at", "body", "date-time", o.ExpiresAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create node install token OK body based on context it is used +func (o *CreateNodeInstallTokenOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *CreateNodeInstallTokenOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *CreateNodeInstallTokenOKBody) UnmarshalBinary(b []byte) error { + var res CreateNodeInstallTokenOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/management/v1/json/client/management_service/discover_azure_database_parameters.go b/api/management/v1/json/client/management_service/discover_azure_database_parameters.go index f5f9f75a926..75b1e24acba 100644 --- a/api/management/v1/json/client/management_service/discover_azure_database_parameters.go +++ b/api/management/v1/json/client/management_service/discover_azure_database_parameters.go @@ -60,6 +60,7 @@ DiscoverAzureDatabaseParams contains all the parameters to send to the API endpo Typically these are written to a http.Request. */ type DiscoverAzureDatabaseParams struct { + /* Body. DiscoverAzureDatabaseRequest discover azure databases request. @@ -132,6 +133,7 @@ func (o *DiscoverAzureDatabaseParams) SetBody(body DiscoverAzureDatabaseBody) { // WriteToRequest writes these params to a swagger request func (o *DiscoverAzureDatabaseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/discover_azure_database_responses.go b/api/management/v1/json/client/management_service/discover_azure_database_responses.go index ee99deb5004..b8bf675e43f 100644 --- a/api/management/v1/json/client/management_service/discover_azure_database_responses.go +++ b/api/management/v1/json/client/management_service/discover_azure_database_responses.go @@ -8,7 +8,6 @@ package management_service import ( "context" "encoding/json" - stderrors "errors" "fmt" "io" "strconv" @@ -26,7 +25,7 @@ type DiscoverAzureDatabaseReader struct { } // ReadResponse reads a server response into the received o. -func (o *DiscoverAzureDatabaseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { +func (o *DiscoverAzureDatabaseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewDiscoverAzureDatabaseOK() @@ -105,10 +104,11 @@ func (o *DiscoverAzureDatabaseOK) GetPayload() *DiscoverAzureDatabaseOKBody { } func (o *DiscoverAzureDatabaseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(DiscoverAzureDatabaseOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -178,10 +178,11 @@ func (o *DiscoverAzureDatabaseDefault) GetPayload() *DiscoverAzureDatabaseDefaul } func (o *DiscoverAzureDatabaseDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(DiscoverAzureDatabaseDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -193,6 +194,7 @@ DiscoverAzureDatabaseBody DiscoverAzureDatabaseRequest discover azure databases swagger:model DiscoverAzureDatabaseBody */ type DiscoverAzureDatabaseBody struct { + // Azure client ID. AzureClientID string `json:"azure_client_id,omitempty"` @@ -239,6 +241,7 @@ DiscoverAzureDatabaseDefaultBody discover azure database default body swagger:model DiscoverAzureDatabaseDefaultBody */ type DiscoverAzureDatabaseDefaultBody struct { + // code Code int32 `json:"code,omitempty"` @@ -275,15 +278,11 @@ func (o *DiscoverAzureDatabaseDefaultBody) validateDetails(formats strfmt.Regist if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } @@ -308,7 +307,9 @@ func (o *DiscoverAzureDatabaseDefaultBody) ContextValidate(ctx context.Context, } func (o *DiscoverAzureDatabaseDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -316,18 +317,15 @@ func (o *DiscoverAzureDatabaseDefaultBody) contextValidateDetails(ctx context.Co } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -356,17 +354,19 @@ DiscoverAzureDatabaseDefaultBodyDetailsItems0 discover azure database default bo swagger:model DiscoverAzureDatabaseDefaultBodyDetailsItems0 */ type DiscoverAzureDatabaseDefaultBodyDetailsItems0 struct { + // at type AtType string `json:"@type,omitempty"` // discover azure database default body details items0 - DiscoverAzureDatabaseDefaultBodyDetailsItems0 map[string]any `json:"-"` + DiscoverAzureDatabaseDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *DiscoverAzureDatabaseDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -387,9 +387,9 @@ func (o *DiscoverAzureDatabaseDefaultBodyDetailsItems0) UnmarshalJSON(data []byt delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]any) + result := make(map[string]interface{}) for k, v := range stage2 { - var toadd any + var toadd interface{} if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -404,6 +404,7 @@ func (o *DiscoverAzureDatabaseDefaultBodyDetailsItems0) UnmarshalJSON(data []byt // MarshalJSON marshals this object with additional properties into a JSON object func (o DiscoverAzureDatabaseDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -467,6 +468,7 @@ DiscoverAzureDatabaseOKBody DiscoverAzureDatabaseResponse discover azure databas swagger:model DiscoverAzureDatabaseOKBody */ type DiscoverAzureDatabaseOKBody struct { + // azure database instance AzureDatabaseInstance []*DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 `json:"azure_database_instance"` } @@ -497,15 +499,11 @@ func (o *DiscoverAzureDatabaseOKBody) validateAzureDatabaseInstance(formats strf if o.AzureDatabaseInstance[i] != nil { if err := o.AzureDatabaseInstance[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) } - return err } } @@ -530,7 +528,9 @@ func (o *DiscoverAzureDatabaseOKBody) ContextValidate(ctx context.Context, forma } func (o *DiscoverAzureDatabaseOKBody) contextValidateAzureDatabaseInstance(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.AzureDatabaseInstance); i++ { + if o.AzureDatabaseInstance[i] != nil { if swag.IsZero(o.AzureDatabaseInstance[i]) { // not required @@ -538,18 +538,15 @@ func (o *DiscoverAzureDatabaseOKBody) contextValidateAzureDatabaseInstance(ctx c } if err := o.AzureDatabaseInstance[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -578,6 +575,7 @@ DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 DiscoverAzureDatabaseInst swagger:model DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 */ type DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 struct { + // Azure database instance ID. InstanceID string `json:"instance_id,omitempty"` @@ -599,19 +597,19 @@ type DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 struct { // Environment tag. Environment string `json:"environment,omitempty"` - // DiscoverAzureDatabaseType describes supported Azure Database instance engines. - // - // - DISCOVER_AZURE_DATABASE_TYPE_MYSQL: MySQL type: microsoft.dbformysql or MariaDB type: microsoft.dbformariadb - // - DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL: PostgreSQL type: microsoft.dbformysql - // Enum: ["DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED","DISCOVER_AZURE_DATABASE_TYPE_MYSQL","DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL"] - Type *string `json:"type,omitempty"` - // Azure database availability zone. Az string `json:"az,omitempty"` // Represents a purchasable Stock Keeping Unit (SKU) under a product. // https://docs.microsoft.com/en-us/partner-center/develop/product-resources#sku. NodeModel string `json:"node_model,omitempty"` + + // DiscoverAzureDatabaseType describes supported Azure Database instance engines. + // + // - DISCOVER_AZURE_DATABASE_TYPE_MYSQL: MySQL type: microsoft.dbformysql or MariaDB type: microsoft.dbformariadb + // - DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL: PostgreSQL type: microsoft.dbformysql + // Enum: ["DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED","DISCOVER_AZURE_DATABASE_TYPE_MYSQL","DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL"] + Type *string `json:"type,omitempty"` } // Validate validates this discover azure database OK body azure database instance items0 @@ -628,7 +626,7 @@ func (o *DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0) Validate(format return nil } -var discoverAzureDatabaseOkBodyAzureDatabaseInstanceItems0TypeTypePropEnum []any +var discoverAzureDatabaseOkBodyAzureDatabaseInstanceItems0TypeTypePropEnum []interface{} func init() { var res []string diff --git a/api/management/v1/json/client/management_service/discover_rds_parameters.go b/api/management/v1/json/client/management_service/discover_rds_parameters.go index ef5c0058c50..93e9487d969 100644 --- a/api/management/v1/json/client/management_service/discover_rds_parameters.go +++ b/api/management/v1/json/client/management_service/discover_rds_parameters.go @@ -60,6 +60,7 @@ DiscoverRDSParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type DiscoverRDSParams struct { + // Body. Body DiscoverRDSBody @@ -129,6 +130,7 @@ func (o *DiscoverRDSParams) SetBody(body DiscoverRDSBody) { // WriteToRequest writes these params to a swagger request func (o *DiscoverRDSParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/discover_rds_responses.go b/api/management/v1/json/client/management_service/discover_rds_responses.go index b8743c96b40..6e80848a2e7 100644 --- a/api/management/v1/json/client/management_service/discover_rds_responses.go +++ b/api/management/v1/json/client/management_service/discover_rds_responses.go @@ -8,7 +8,6 @@ package management_service import ( "context" "encoding/json" - stderrors "errors" "fmt" "io" "strconv" @@ -26,7 +25,7 @@ type DiscoverRDSReader struct { } // ReadResponse reads a server response into the received o. -func (o *DiscoverRDSReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { +func (o *DiscoverRDSReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewDiscoverRDSOK() @@ -105,10 +104,11 @@ func (o *DiscoverRDSOK) GetPayload() *DiscoverRDSOKBody { } func (o *DiscoverRDSOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(DiscoverRDSOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -178,10 +178,11 @@ func (o *DiscoverRDSDefault) GetPayload() *DiscoverRDSDefaultBody { } func (o *DiscoverRDSDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(DiscoverRDSDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -193,6 +194,7 @@ DiscoverRDSBody discover RDS body swagger:model DiscoverRDSBody */ type DiscoverRDSBody struct { + // AWS Access key. Optional. AWSAccessKey string `json:"aws_access_key,omitempty"` @@ -233,6 +235,7 @@ DiscoverRDSDefaultBody discover RDS default body swagger:model DiscoverRDSDefaultBody */ type DiscoverRDSDefaultBody struct { + // code Code int32 `json:"code,omitempty"` @@ -269,15 +272,11 @@ func (o *DiscoverRDSDefaultBody) validateDetails(formats strfmt.Registry) error if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } @@ -302,7 +301,9 @@ func (o *DiscoverRDSDefaultBody) ContextValidate(ctx context.Context, formats st } func (o *DiscoverRDSDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -310,18 +311,15 @@ func (o *DiscoverRDSDefaultBody) contextValidateDetails(ctx context.Context, for } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -350,17 +348,19 @@ DiscoverRDSDefaultBodyDetailsItems0 discover RDS default body details items0 swagger:model DiscoverRDSDefaultBodyDetailsItems0 */ type DiscoverRDSDefaultBodyDetailsItems0 struct { + // at type AtType string `json:"@type,omitempty"` // discover RDS default body details items0 - DiscoverRDSDefaultBodyDetailsItems0 map[string]any `json:"-"` + DiscoverRDSDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *DiscoverRDSDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -381,9 +381,9 @@ func (o *DiscoverRDSDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]any) + result := make(map[string]interface{}) for k, v := range stage2 { - var toadd any + var toadd interface{} if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -398,6 +398,7 @@ func (o *DiscoverRDSDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // MarshalJSON marshals this object with additional properties into a JSON object func (o DiscoverRDSDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -461,6 +462,7 @@ DiscoverRDSOKBody discover RDS OK body swagger:model DiscoverRDSOKBody */ type DiscoverRDSOKBody struct { + // rds instances RDSInstances []*DiscoverRDSOKBodyRDSInstancesItems0 `json:"rds_instances"` } @@ -491,15 +493,11 @@ func (o *DiscoverRDSOKBody) validateRDSInstances(formats strfmt.Registry) error if o.RDSInstances[i] != nil { if err := o.RDSInstances[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) } - return err } } @@ -524,7 +522,9 @@ func (o *DiscoverRDSOKBody) ContextValidate(ctx context.Context, formats strfmt. } func (o *DiscoverRDSOKBody) contextValidateRDSInstances(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.RDSInstances); i++ { + if o.RDSInstances[i] != nil { if swag.IsZero(o.RDSInstances[i]) { // not required @@ -532,18 +532,15 @@ func (o *DiscoverRDSOKBody) contextValidateRDSInstances(ctx context.Context, for } if err := o.RDSInstances[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -572,6 +569,7 @@ DiscoverRDSOKBodyRDSInstancesItems0 DiscoverRDSInstance models an unique RDS ins swagger:model DiscoverRDSOKBodyRDSInstancesItems0 */ type DiscoverRDSOKBodyRDSInstancesItems0 struct { + // AWS region. Region string `json:"region,omitempty"` @@ -590,12 +588,12 @@ type DiscoverRDSOKBodyRDSInstancesItems0 struct { // Access port. Port int64 `json:"port,omitempty"` + // Engine version. + EngineVersion string `json:"engine_version,omitempty"` + // DiscoverRDSEngine describes supported RDS instance engines. // Enum: ["DISCOVER_RDS_ENGINE_UNSPECIFIED","DISCOVER_RDS_ENGINE_MYSQL","DISCOVER_RDS_ENGINE_POSTGRESQL"] Engine *string `json:"engine,omitempty"` - - // Engine version. - EngineVersion string `json:"engine_version,omitempty"` } // Validate validates this discover RDS OK body RDS instances items0 @@ -612,7 +610,7 @@ func (o *DiscoverRDSOKBodyRDSInstancesItems0) Validate(formats strfmt.Registry) return nil } -var discoverRdsOkBodyRdsInstancesItems0TypeEnginePropEnum []any +var discoverRdsOkBodyRdsInstancesItems0TypeEnginePropEnum []interface{} func init() { var res []string diff --git a/api/management/v1/json/client/management_service/get_node_parameters.go b/api/management/v1/json/client/management_service/get_node_parameters.go index 63aa4bdf7c6..73629cc22da 100644 --- a/api/management/v1/json/client/management_service/get_node_parameters.go +++ b/api/management/v1/json/client/management_service/get_node_parameters.go @@ -60,6 +60,7 @@ GetNodeParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type GetNodeParams struct { + /* NodeID. Unique Node identifier. @@ -132,6 +133,7 @@ func (o *GetNodeParams) SetNodeID(nodeID string) { // WriteToRequest writes these params to a swagger request func (o *GetNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/get_node_responses.go b/api/management/v1/json/client/management_service/get_node_responses.go index 241eb92bed5..aead75b9805 100644 --- a/api/management/v1/json/client/management_service/get_node_responses.go +++ b/api/management/v1/json/client/management_service/get_node_responses.go @@ -8,7 +8,6 @@ package management_service import ( "context" "encoding/json" - stderrors "errors" "fmt" "io" "strconv" @@ -26,7 +25,7 @@ type GetNodeReader struct { } // ReadResponse reads a server response into the received o. -func (o *GetNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { +func (o *GetNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewGetNodeOK() @@ -105,10 +104,11 @@ func (o *GetNodeOK) GetPayload() *GetNodeOKBody { } func (o *GetNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(GetNodeOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -178,10 +178,11 @@ func (o *GetNodeDefault) GetPayload() *GetNodeDefaultBody { } func (o *GetNodeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(GetNodeDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -193,6 +194,7 @@ GetNodeDefaultBody get node default body swagger:model GetNodeDefaultBody */ type GetNodeDefaultBody struct { + // code Code int32 `json:"code,omitempty"` @@ -229,15 +231,11 @@ func (o *GetNodeDefaultBody) validateDetails(formats strfmt.Registry) error { if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } @@ -262,7 +260,9 @@ func (o *GetNodeDefaultBody) ContextValidate(ctx context.Context, formats strfmt } func (o *GetNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -270,18 +270,15 @@ func (o *GetNodeDefaultBody) contextValidateDetails(ctx context.Context, formats } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -310,17 +307,19 @@ GetNodeDefaultBodyDetailsItems0 get node default body details items0 swagger:model GetNodeDefaultBodyDetailsItems0 */ type GetNodeDefaultBodyDetailsItems0 struct { + // at type AtType string `json:"@type,omitempty"` // get node default body details items0 - GetNodeDefaultBodyDetailsItems0 map[string]any `json:"-"` + GetNodeDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *GetNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -341,9 +340,9 @@ func (o *GetNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]any) + result := make(map[string]interface{}) for k, v := range stage2 { - var toadd any + var toadd interface{} if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -358,6 +357,7 @@ func (o *GetNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // MarshalJSON marshals this object with additional properties into a JSON object func (o GetNodeDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -421,6 +421,7 @@ GetNodeOKBody get node OK body swagger:model GetNodeOKBody */ type GetNodeOKBody struct { + // node Node *GetNodeOKBodyNode `json:"node,omitempty"` } @@ -446,15 +447,11 @@ func (o *GetNodeOKBody) validateNode(formats strfmt.Registry) error { if o.Node != nil { if err := o.Node.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getNodeOk" + "." + "node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("getNodeOk" + "." + "node") } - return err } } @@ -477,6 +474,7 @@ func (o *GetNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Regi } func (o *GetNodeOKBody) contextValidateNode(ctx context.Context, formats strfmt.Registry) error { + if o.Node != nil { if swag.IsZero(o.Node) { // not required @@ -484,15 +482,11 @@ func (o *GetNodeOKBody) contextValidateNode(ctx context.Context, formats strfmt. } if err := o.Node.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getNodeOk" + "." + "node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("getNodeOk" + "." + "node") } - return err } } @@ -523,6 +517,7 @@ GetNodeOKBodyNode get node OK body node swagger:model GetNodeOKBodyNode */ type GetNodeOKBodyNode struct { + // Unique Node identifier. NodeID string `json:"node_id,omitempty"` @@ -567,15 +562,6 @@ type GetNodeOKBodyNode struct { // Format: date-time UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` - // Node status. - // - // - STATUS_UNSPECIFIED: Invalid status. - // - STATUS_UP: The node is up. - // - STATUS_DOWN: The node is down. - // - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet). - // Enum: ["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` - // List of agents related to this node. Agents []*GetNodeOKBodyNodeAgentsItems0 `json:"agents"` @@ -587,6 +573,15 @@ type GetNodeOKBodyNode struct { // True if this node is a PMM Server node (HA mode). IsPMMServerNode bool `json:"is_pmm_server_node,omitempty"` + + // Node status. + // + // - STATUS_UNSPECIFIED: Invalid status. + // - STATUS_UP: The node is up. + // - STATUS_DOWN: The node is down. + // - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet). + // Enum: ["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` } // Validate validates this get node OK body node @@ -601,15 +596,15 @@ func (o *GetNodeOKBodyNode) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateAgents(formats); err != nil { res = append(res, err) } - if err := o.validateAgents(formats); err != nil { + if err := o.validateServices(formats); err != nil { res = append(res, err) } - if err := o.validateServices(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -643,54 +638,6 @@ func (o *GetNodeOKBodyNode) validateUpdatedAt(formats strfmt.Registry) error { return nil } -var getNodeOkBodyNodeTypeStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - getNodeOkBodyNodeTypeStatusPropEnum = append(getNodeOkBodyNodeTypeStatusPropEnum, v) - } -} - -const ( - - // GetNodeOKBodyNodeStatusSTATUSUNSPECIFIED captures enum value "STATUS_UNSPECIFIED" - GetNodeOKBodyNodeStatusSTATUSUNSPECIFIED string = "STATUS_UNSPECIFIED" - - // GetNodeOKBodyNodeStatusSTATUSUP captures enum value "STATUS_UP" - GetNodeOKBodyNodeStatusSTATUSUP string = "STATUS_UP" - - // GetNodeOKBodyNodeStatusSTATUSDOWN captures enum value "STATUS_DOWN" - GetNodeOKBodyNodeStatusSTATUSDOWN string = "STATUS_DOWN" - - // GetNodeOKBodyNodeStatusSTATUSUNKNOWN captures enum value "STATUS_UNKNOWN" - GetNodeOKBodyNodeStatusSTATUSUNKNOWN string = "STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetNodeOKBodyNode) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getNodeOkBodyNodeTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetNodeOKBodyNode) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getNodeOk"+"."+"node"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - func (o *GetNodeOKBodyNode) validateAgents(formats strfmt.Registry) error { if swag.IsZero(o.Agents) { // not required return nil @@ -703,15 +650,11 @@ func (o *GetNodeOKBodyNode) validateAgents(formats strfmt.Registry) error { if o.Agents[i] != nil { if err := o.Agents[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getNodeOk" + "." + "node" + "." + "agents" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("getNodeOk" + "." + "node" + "." + "agents" + "." + strconv.Itoa(i)) } - return err } } @@ -733,15 +676,11 @@ func (o *GetNodeOKBodyNode) validateServices(formats strfmt.Registry) error { if o.Services[i] != nil { if err := o.Services[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getNodeOk" + "." + "node" + "." + "services" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("getNodeOk" + "." + "node" + "." + "services" + "." + strconv.Itoa(i)) } - return err } } @@ -751,6 +690,54 @@ func (o *GetNodeOKBodyNode) validateServices(formats strfmt.Registry) error { return nil } +var getNodeOkBodyNodeTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + getNodeOkBodyNodeTypeStatusPropEnum = append(getNodeOkBodyNodeTypeStatusPropEnum, v) + } +} + +const ( + + // GetNodeOKBodyNodeStatusSTATUSUNSPECIFIED captures enum value "STATUS_UNSPECIFIED" + GetNodeOKBodyNodeStatusSTATUSUNSPECIFIED string = "STATUS_UNSPECIFIED" + + // GetNodeOKBodyNodeStatusSTATUSUP captures enum value "STATUS_UP" + GetNodeOKBodyNodeStatusSTATUSUP string = "STATUS_UP" + + // GetNodeOKBodyNodeStatusSTATUSDOWN captures enum value "STATUS_DOWN" + GetNodeOKBodyNodeStatusSTATUSDOWN string = "STATUS_DOWN" + + // GetNodeOKBodyNodeStatusSTATUSUNKNOWN captures enum value "STATUS_UNKNOWN" + GetNodeOKBodyNodeStatusSTATUSUNKNOWN string = "STATUS_UNKNOWN" +) + +// prop value enum +func (o *GetNodeOKBodyNode) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, getNodeOkBodyNodeTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *GetNodeOKBodyNode) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("getNodeOk"+"."+"node"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + // ContextValidate validate this get node OK body node based on the context it is used func (o *GetNodeOKBodyNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -770,7 +757,9 @@ func (o *GetNodeOKBodyNode) ContextValidate(ctx context.Context, formats strfmt. } func (o *GetNodeOKBodyNode) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Agents); i++ { + if o.Agents[i] != nil { if swag.IsZero(o.Agents[i]) { // not required @@ -778,25 +767,24 @@ func (o *GetNodeOKBodyNode) contextValidateAgents(ctx context.Context, formats s } if err := o.Agents[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getNodeOk" + "." + "node" + "." + "agents" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("getNodeOk" + "." + "node" + "." + "agents" + "." + strconv.Itoa(i)) } - return err } } + } return nil } func (o *GetNodeOKBodyNode) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Services); i++ { + if o.Services[i] != nil { if swag.IsZero(o.Services[i]) { // not required @@ -804,18 +792,15 @@ func (o *GetNodeOKBodyNode) contextValidateServices(ctx context.Context, formats } if err := o.Services[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getNodeOk" + "." + "node" + "." + "services" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("getNodeOk" + "." + "node" + "." + "services" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -844,6 +829,7 @@ GetNodeOKBodyNodeAgentsItems0 get node OK body node agents items0 swagger:model GetNodeOKBodyNodeAgentsItems0 */ type GetNodeOKBodyNodeAgentsItems0 struct { + // Unique Agent identifier. AgentID string `json:"agent_id,omitempty"` @@ -890,6 +876,7 @@ GetNodeOKBodyNodeServicesItems0 Service represents a service running on a node. swagger:model GetNodeOKBodyNodeServicesItems0 */ type GetNodeOKBodyNodeServicesItems0 struct { + // Unique Service identifier. ServiceID string `json:"service_id,omitempty"` diff --git a/api/management/v1/json/client/management_service/list_agent_versions_parameters.go b/api/management/v1/json/client/management_service/list_agent_versions_parameters.go index d7f16fa9b2d..97d2ce24b71 100644 --- a/api/management/v1/json/client/management_service/list_agent_versions_parameters.go +++ b/api/management/v1/json/client/management_service/list_agent_versions_parameters.go @@ -115,6 +115,7 @@ func (o *ListAgentVersionsParams) SetHTTPClient(client *http.Client) { // WriteToRequest writes these params to a swagger request func (o *ListAgentVersionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/list_agent_versions_responses.go b/api/management/v1/json/client/management_service/list_agent_versions_responses.go index a0a8858d962..af03219404b 100644 --- a/api/management/v1/json/client/management_service/list_agent_versions_responses.go +++ b/api/management/v1/json/client/management_service/list_agent_versions_responses.go @@ -8,7 +8,6 @@ package management_service import ( "context" "encoding/json" - stderrors "errors" "fmt" "io" "strconv" @@ -26,7 +25,7 @@ type ListAgentVersionsReader struct { } // ReadResponse reads a server response into the received o. -func (o *ListAgentVersionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { +func (o *ListAgentVersionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewListAgentVersionsOK() @@ -105,10 +104,11 @@ func (o *ListAgentVersionsOK) GetPayload() *ListAgentVersionsOKBody { } func (o *ListAgentVersionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(ListAgentVersionsOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -178,10 +178,11 @@ func (o *ListAgentVersionsDefault) GetPayload() *ListAgentVersionsDefaultBody { } func (o *ListAgentVersionsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(ListAgentVersionsDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -193,6 +194,7 @@ ListAgentVersionsDefaultBody list agent versions default body swagger:model ListAgentVersionsDefaultBody */ type ListAgentVersionsDefaultBody struct { + // code Code int32 `json:"code,omitempty"` @@ -229,15 +231,11 @@ func (o *ListAgentVersionsDefaultBody) validateDetails(formats strfmt.Registry) if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListAgentVersions default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("ListAgentVersions default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } @@ -262,7 +260,9 @@ func (o *ListAgentVersionsDefaultBody) ContextValidate(ctx context.Context, form } func (o *ListAgentVersionsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -270,18 +270,15 @@ func (o *ListAgentVersionsDefaultBody) contextValidateDetails(ctx context.Contex } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListAgentVersions default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("ListAgentVersions default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -310,17 +307,19 @@ ListAgentVersionsDefaultBodyDetailsItems0 list agent versions default body detai swagger:model ListAgentVersionsDefaultBodyDetailsItems0 */ type ListAgentVersionsDefaultBodyDetailsItems0 struct { + // at type AtType string `json:"@type,omitempty"` // list agent versions default body details items0 - ListAgentVersionsDefaultBodyDetailsItems0 map[string]any `json:"-"` + ListAgentVersionsDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *ListAgentVersionsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -341,9 +340,9 @@ func (o *ListAgentVersionsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) e delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]any) + result := make(map[string]interface{}) for k, v := range stage2 { - var toadd any + var toadd interface{} if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -358,6 +357,7 @@ func (o *ListAgentVersionsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) e // MarshalJSON marshals this object with additional properties into a JSON object func (o ListAgentVersionsDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -421,6 +421,7 @@ ListAgentVersionsOKBody list agent versions OK body swagger:model ListAgentVersionsOKBody */ type ListAgentVersionsOKBody struct { + // List of Agent versions. AgentVersions []*ListAgentVersionsOKBodyAgentVersionsItems0 `json:"agent_versions"` } @@ -451,15 +452,11 @@ func (o *ListAgentVersionsOKBody) validateAgentVersions(formats strfmt.Registry) if o.AgentVersions[i] != nil { if err := o.AgentVersions[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentVersionsOk" + "." + "agent_versions" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("listAgentVersionsOk" + "." + "agent_versions" + "." + strconv.Itoa(i)) } - return err } } @@ -484,7 +481,9 @@ func (o *ListAgentVersionsOKBody) ContextValidate(ctx context.Context, formats s } func (o *ListAgentVersionsOKBody) contextValidateAgentVersions(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.AgentVersions); i++ { + if o.AgentVersions[i] != nil { if swag.IsZero(o.AgentVersions[i]) { // not required @@ -492,18 +491,15 @@ func (o *ListAgentVersionsOKBody) contextValidateAgentVersions(ctx context.Conte } if err := o.AgentVersions[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentVersionsOk" + "." + "agent_versions" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("listAgentVersionsOk" + "." + "agent_versions" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -532,6 +528,7 @@ ListAgentVersionsOKBodyAgentVersionsItems0 list agent versions OK body agent ver swagger:model ListAgentVersionsOKBodyAgentVersionsItems0 */ type ListAgentVersionsOKBodyAgentVersionsItems0 struct { + // Agent ID. AgentID string `json:"agent_id,omitempty"` @@ -563,7 +560,7 @@ func (o *ListAgentVersionsOKBodyAgentVersionsItems0) Validate(formats strfmt.Reg return nil } -var listAgentVersionsOkBodyAgentVersionsItems0TypeSeverityPropEnum []any +var listAgentVersionsOkBodyAgentVersionsItems0TypeSeverityPropEnum []interface{} func init() { var res []string diff --git a/api/management/v1/json/client/management_service/list_agents_parameters.go b/api/management/v1/json/client/management_service/list_agents_parameters.go index 5dd7b7b6a4f..7c16816c10a 100644 --- a/api/management/v1/json/client/management_service/list_agents_parameters.go +++ b/api/management/v1/json/client/management_service/list_agents_parameters.go @@ -60,6 +60,7 @@ ListAgentsParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type ListAgentsParams struct { + /* NodeID. Return only Agents that relate to a specific NodeID. @@ -149,6 +150,7 @@ func (o *ListAgentsParams) SetServiceID(serviceID *string) { // WriteToRequest writes these params to a swagger request func (o *ListAgentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } @@ -164,6 +166,7 @@ func (o *ListAgentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re } qNodeID := qrNodeID if qNodeID != "" { + if err := r.SetQueryParam("node_id", qNodeID); err != nil { return err } @@ -180,6 +183,7 @@ func (o *ListAgentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re } qServiceID := qrServiceID if qServiceID != "" { + if err := r.SetQueryParam("service_id", qServiceID); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/list_agents_responses.go b/api/management/v1/json/client/management_service/list_agents_responses.go index 2da78ec1324..ebe0b523dbd 100644 --- a/api/management/v1/json/client/management_service/list_agents_responses.go +++ b/api/management/v1/json/client/management_service/list_agents_responses.go @@ -8,7 +8,6 @@ package management_service import ( "context" "encoding/json" - stderrors "errors" "fmt" "io" "strconv" @@ -26,7 +25,7 @@ type ListAgentsReader struct { } // ReadResponse reads a server response into the received o. -func (o *ListAgentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { +func (o *ListAgentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewListAgentsOK() @@ -105,10 +104,11 @@ func (o *ListAgentsOK) GetPayload() *ListAgentsOKBody { } func (o *ListAgentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(ListAgentsOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -178,10 +178,11 @@ func (o *ListAgentsDefault) GetPayload() *ListAgentsDefaultBody { } func (o *ListAgentsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(ListAgentsDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -193,6 +194,7 @@ ListAgentsDefaultBody list agents default body swagger:model ListAgentsDefaultBody */ type ListAgentsDefaultBody struct { + // code Code int32 `json:"code,omitempty"` @@ -229,15 +231,11 @@ func (o *ListAgentsDefaultBody) validateDetails(formats strfmt.Registry) error { if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } @@ -262,7 +260,9 @@ func (o *ListAgentsDefaultBody) ContextValidate(ctx context.Context, formats str } func (o *ListAgentsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -270,18 +270,15 @@ func (o *ListAgentsDefaultBody) contextValidateDetails(ctx context.Context, form } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -310,17 +307,19 @@ ListAgentsDefaultBodyDetailsItems0 list agents default body details items0 swagger:model ListAgentsDefaultBodyDetailsItems0 */ type ListAgentsDefaultBodyDetailsItems0 struct { + // at type AtType string `json:"@type,omitempty"` // list agents default body details items0 - ListAgentsDefaultBodyDetailsItems0 map[string]any `json:"-"` + ListAgentsDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *ListAgentsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -341,9 +340,9 @@ func (o *ListAgentsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]any) + result := make(map[string]interface{}) for k, v := range stage2 { - var toadd any + var toadd interface{} if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -358,6 +357,7 @@ func (o *ListAgentsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // MarshalJSON marshals this object with additional properties into a JSON object func (o ListAgentsDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -421,6 +421,7 @@ ListAgentsOKBody list agents OK body swagger:model ListAgentsOKBody */ type ListAgentsOKBody struct { + // List of Agents. Agents []*ListAgentsOKBodyAgentsItems0 `json:"agents"` } @@ -451,15 +452,11 @@ func (o *ListAgentsOKBody) validateAgents(formats strfmt.Registry) error { if o.Agents[i] != nil { if err := o.Agents[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentsOk" + "." + "agents" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("listAgentsOk" + "." + "agents" + "." + strconv.Itoa(i)) } - return err } } @@ -484,7 +481,9 @@ func (o *ListAgentsOKBody) ContextValidate(ctx context.Context, formats strfmt.R } func (o *ListAgentsOKBody) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Agents); i++ { + if o.Agents[i] != nil { if swag.IsZero(o.Agents[i]) { // not required @@ -492,18 +491,15 @@ func (o *ListAgentsOKBody) contextValidateAgents(ctx context.Context, formats st } if err := o.Agents[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentsOk" + "." + "agents" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("listAgentsOk" + "." + "agents" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -532,6 +528,7 @@ ListAgentsOKBodyAgentsItems0 list agents OK body agents items0 swagger:model ListAgentsOKBodyAgentsItems0 */ type ListAgentsOKBodyAgentsItems0 struct { + // Unique agent identifier. AgentID string `json:"agent_id,omitempty"` @@ -563,12 +560,6 @@ type ListAgentsOKBodyAgentsItems0 struct { // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // Limit query length in QAN. MaxQueryLength int32 `json:"max_query_length,omitempty"` @@ -647,12 +638,15 @@ type ListAgentsOKBodyAgentsItems0 struct { // True if an exporter agent is exposed on all host addresses. ExposeExporter bool `json:"expose_exporter,omitempty"` - // valkey options - ValkeyOptions any `json:"valkey_options,omitempty"` - // azure options AzureOptions *ListAgentsOKBodyAgentsItems0AzureOptions `json:"azure_options,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // mongo db options MongoDBOptions *ListAgentsOKBodyAgentsItems0MongoDBOptions `json:"mongo_db_options,omitempty"` @@ -664,6 +658,9 @@ type ListAgentsOKBodyAgentsItems0 struct { // rta options RtaOptions *ListAgentsOKBodyAgentsItems0RtaOptions `json:"rta_options,omitempty"` + + // valkey options + ValkeyOptions interface{} `json:"valkey_options,omitempty"` } // Validate validates this list agents OK body agents items0 @@ -674,15 +671,15 @@ func (o *ListAgentsOKBodyAgentsItems0) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateUpdatedAt(formats); err != nil { res = append(res, err) } - if err := o.validateUpdatedAt(formats); err != nil { + if err := o.validateAzureOptions(formats); err != nil { res = append(res, err) } - if err := o.validateAzureOptions(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } @@ -720,7 +717,38 @@ func (o *ListAgentsOKBodyAgentsItems0) validateCreatedAt(formats strfmt.Registry return nil } -var listAgentsOkBodyAgentsItems0TypeLogLevelPropEnum []any +func (o *ListAgentsOKBodyAgentsItems0) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(o.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updated_at", "body", "date-time", o.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ListAgentsOKBodyAgentsItems0) validateAzureOptions(formats strfmt.Registry) error { + if swag.IsZero(o.AzureOptions) { // not required + return nil + } + + if o.AzureOptions != nil { + if err := o.AzureOptions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("azure_options") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("azure_options") + } + return err + } + } + + return nil +} + +var listAgentsOkBodyAgentsItems0TypeLogLevelPropEnum []interface{} func init() { var res []string @@ -774,41 +802,6 @@ func (o *ListAgentsOKBodyAgentsItems0) validateLogLevel(formats strfmt.Registry) return nil } -func (o *ListAgentsOKBodyAgentsItems0) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updated_at", "body", "date-time", o.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListAgentsOKBodyAgentsItems0) validateAzureOptions(formats strfmt.Registry) error { - if swag.IsZero(o.AzureOptions) { // not required - return nil - } - - if o.AzureOptions != nil { - if err := o.AzureOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("azure_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("azure_options") - } - - return err - } - } - - return nil -} - func (o *ListAgentsOKBodyAgentsItems0) validateMongoDBOptions(formats strfmt.Registry) error { if swag.IsZero(o.MongoDBOptions) { // not required return nil @@ -816,15 +809,11 @@ func (o *ListAgentsOKBodyAgentsItems0) validateMongoDBOptions(formats strfmt.Reg if o.MongoDBOptions != nil { if err := o.MongoDBOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mongo_db_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("mongo_db_options") } - return err } } @@ -839,15 +828,11 @@ func (o *ListAgentsOKBodyAgentsItems0) validateMysqlOptions(formats strfmt.Regis if o.MysqlOptions != nil { if err := o.MysqlOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mysql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("mysql_options") } - return err } } @@ -862,15 +847,11 @@ func (o *ListAgentsOKBodyAgentsItems0) validatePostgresqlOptions(formats strfmt. if o.PostgresqlOptions != nil { if err := o.PostgresqlOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("postgresql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("postgresql_options") } - return err } } @@ -885,15 +866,11 @@ func (o *ListAgentsOKBodyAgentsItems0) validateRtaOptions(formats strfmt.Registr if o.RtaOptions != nil { if err := o.RtaOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("rta_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("rta_options") } - return err } } @@ -932,6 +909,7 @@ func (o *ListAgentsOKBodyAgentsItems0) ContextValidate(ctx context.Context, form } func (o *ListAgentsOKBodyAgentsItems0) contextValidateAzureOptions(ctx context.Context, formats strfmt.Registry) error { + if o.AzureOptions != nil { if swag.IsZero(o.AzureOptions) { // not required @@ -939,15 +917,11 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateAzureOptions(ctx context.C } if err := o.AzureOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("azure_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("azure_options") } - return err } } @@ -956,6 +930,7 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateAzureOptions(ctx context.C } func (o *ListAgentsOKBodyAgentsItems0) contextValidateMongoDBOptions(ctx context.Context, formats strfmt.Registry) error { + if o.MongoDBOptions != nil { if swag.IsZero(o.MongoDBOptions) { // not required @@ -963,15 +938,11 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateMongoDBOptions(ctx context } if err := o.MongoDBOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mongo_db_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("mongo_db_options") } - return err } } @@ -980,6 +951,7 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateMongoDBOptions(ctx context } func (o *ListAgentsOKBodyAgentsItems0) contextValidateMysqlOptions(ctx context.Context, formats strfmt.Registry) error { + if o.MysqlOptions != nil { if swag.IsZero(o.MysqlOptions) { // not required @@ -987,15 +959,11 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateMysqlOptions(ctx context.C } if err := o.MysqlOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mysql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("mysql_options") } - return err } } @@ -1004,6 +972,7 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateMysqlOptions(ctx context.C } func (o *ListAgentsOKBodyAgentsItems0) contextValidatePostgresqlOptions(ctx context.Context, formats strfmt.Registry) error { + if o.PostgresqlOptions != nil { if swag.IsZero(o.PostgresqlOptions) { // not required @@ -1011,15 +980,11 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidatePostgresqlOptions(ctx cont } if err := o.PostgresqlOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("postgresql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("postgresql_options") } - return err } } @@ -1028,6 +993,7 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidatePostgresqlOptions(ctx cont } func (o *ListAgentsOKBodyAgentsItems0) contextValidateRtaOptions(ctx context.Context, formats strfmt.Registry) error { + if o.RtaOptions != nil { if swag.IsZero(o.RtaOptions) { // not required @@ -1035,15 +1001,11 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateRtaOptions(ctx context.Con } if err := o.RtaOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("rta_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("rta_options") } - return err } } @@ -1074,6 +1036,7 @@ ListAgentsOKBodyAgentsItems0AzureOptions list agents OK body agents items0 azure swagger:model ListAgentsOKBodyAgentsItems0AzureOptions */ type ListAgentsOKBodyAgentsItems0AzureOptions struct { + // Azure client ID. ClientID string `json:"client_id,omitempty"` @@ -1123,6 +1086,7 @@ ListAgentsOKBodyAgentsItems0MongoDBOptions list agents OK body agents items0 mon swagger:model ListAgentsOKBodyAgentsItems0MongoDBOptions */ type ListAgentsOKBodyAgentsItems0MongoDBOptions struct { + // True if TLS certificate is set. IsTLSCertificateKeySet bool `json:"is_tls_certificate_key_set,omitempty"` @@ -1178,6 +1142,7 @@ ListAgentsOKBodyAgentsItems0MysqlOptions list agents OK body agents items0 mysql swagger:model ListAgentsOKBodyAgentsItems0MysqlOptions */ type ListAgentsOKBodyAgentsItems0MysqlOptions struct { + // True if TLS key is set. IsTLSKeySet bool `json:"is_tls_key_set,omitempty"` @@ -1218,6 +1183,7 @@ ListAgentsOKBodyAgentsItems0PostgresqlOptions list agents OK body agents items0 swagger:model ListAgentsOKBodyAgentsItems0PostgresqlOptions */ type ListAgentsOKBodyAgentsItems0PostgresqlOptions struct { + // True if TLS key is set. IsSslKeySet bool `json:"is_ssl_key_set,omitempty"` @@ -1261,6 +1227,7 @@ ListAgentsOKBodyAgentsItems0RtaOptions RTAOptions holds Real-Time Query Analytic swagger:model ListAgentsOKBodyAgentsItems0RtaOptions */ type ListAgentsOKBodyAgentsItems0RtaOptions struct { + // Query collect interval (default 2s is set by server). CollectInterval string `json:"collect_interval,omitempty"` } diff --git a/api/management/v1/json/client/management_service/list_nodes_parameters.go b/api/management/v1/json/client/management_service/list_nodes_parameters.go index 441e42660e2..eeca2a1f5f7 100644 --- a/api/management/v1/json/client/management_service/list_nodes_parameters.go +++ b/api/management/v1/json/client/management_service/list_nodes_parameters.go @@ -60,6 +60,7 @@ ListNodesParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type ListNodesParams struct { + /* NodeType. Node type to be filtered out. @@ -85,7 +86,9 @@ func (o *ListNodesParams) WithDefaults() *ListNodesParams { // // All values with no default are reset to their zero value. func (o *ListNodesParams) SetDefaults() { - nodeTypeDefault := string("NODE_TYPE_UNSPECIFIED") + var ( + nodeTypeDefault = string("NODE_TYPE_UNSPECIFIED") + ) val := ListNodesParams{ NodeType: &nodeTypeDefault, @@ -143,6 +146,7 @@ func (o *ListNodesParams) SetNodeType(nodeType *string) { // WriteToRequest writes these params to a swagger request func (o *ListNodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } @@ -158,6 +162,7 @@ func (o *ListNodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg } qNodeType := qrNodeType if qNodeType != "" { + if err := r.SetQueryParam("node_type", qNodeType); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/list_nodes_responses.go b/api/management/v1/json/client/management_service/list_nodes_responses.go index d9f378b0034..b1f9404e42f 100644 --- a/api/management/v1/json/client/management_service/list_nodes_responses.go +++ b/api/management/v1/json/client/management_service/list_nodes_responses.go @@ -8,7 +8,6 @@ package management_service import ( "context" "encoding/json" - stderrors "errors" "fmt" "io" "strconv" @@ -26,7 +25,7 @@ type ListNodesReader struct { } // ReadResponse reads a server response into the received o. -func (o *ListNodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { +func (o *ListNodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewListNodesOK() @@ -105,10 +104,11 @@ func (o *ListNodesOK) GetPayload() *ListNodesOKBody { } func (o *ListNodesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(ListNodesOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -178,10 +178,11 @@ func (o *ListNodesDefault) GetPayload() *ListNodesDefaultBody { } func (o *ListNodesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(ListNodesDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -193,6 +194,7 @@ ListNodesDefaultBody list nodes default body swagger:model ListNodesDefaultBody */ type ListNodesDefaultBody struct { + // code Code int32 `json:"code,omitempty"` @@ -229,15 +231,11 @@ func (o *ListNodesDefaultBody) validateDetails(formats strfmt.Registry) error { if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } @@ -262,7 +260,9 @@ func (o *ListNodesDefaultBody) ContextValidate(ctx context.Context, formats strf } func (o *ListNodesDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -270,18 +270,15 @@ func (o *ListNodesDefaultBody) contextValidateDetails(ctx context.Context, forma } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -310,17 +307,19 @@ ListNodesDefaultBodyDetailsItems0 list nodes default body details items0 swagger:model ListNodesDefaultBodyDetailsItems0 */ type ListNodesDefaultBodyDetailsItems0 struct { + // at type AtType string `json:"@type,omitempty"` // list nodes default body details items0 - ListNodesDefaultBodyDetailsItems0 map[string]any `json:"-"` + ListNodesDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *ListNodesDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -341,9 +340,9 @@ func (o *ListNodesDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]any) + result := make(map[string]interface{}) for k, v := range stage2 { - var toadd any + var toadd interface{} if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -358,6 +357,7 @@ func (o *ListNodesDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // MarshalJSON marshals this object with additional properties into a JSON object func (o ListNodesDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -421,6 +421,7 @@ ListNodesOKBody list nodes OK body swagger:model ListNodesOKBody */ type ListNodesOKBody struct { + // nodes Nodes []*ListNodesOKBodyNodesItems0 `json:"nodes"` } @@ -451,15 +452,11 @@ func (o *ListNodesOKBody) validateNodes(formats strfmt.Registry) error { if o.Nodes[i] != nil { if err := o.Nodes[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listNodesOk" + "." + "nodes" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("listNodesOk" + "." + "nodes" + "." + strconv.Itoa(i)) } - return err } } @@ -484,7 +481,9 @@ func (o *ListNodesOKBody) ContextValidate(ctx context.Context, formats strfmt.Re } func (o *ListNodesOKBody) contextValidateNodes(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Nodes); i++ { + if o.Nodes[i] != nil { if swag.IsZero(o.Nodes[i]) { // not required @@ -492,18 +491,15 @@ func (o *ListNodesOKBody) contextValidateNodes(ctx context.Context, formats strf } if err := o.Nodes[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listNodesOk" + "." + "nodes" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("listNodesOk" + "." + "nodes" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -532,6 +528,7 @@ ListNodesOKBodyNodesItems0 list nodes OK body nodes items0 swagger:model ListNodesOKBodyNodesItems0 */ type ListNodesOKBodyNodesItems0 struct { + // Unique Node identifier. NodeID string `json:"node_id,omitempty"` @@ -576,15 +573,6 @@ type ListNodesOKBodyNodesItems0 struct { // Format: date-time UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` - // Node status. - // - // - STATUS_UNSPECIFIED: Invalid status. - // - STATUS_UP: The node is up. - // - STATUS_DOWN: The node is down. - // - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet). - // Enum: ["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` - // List of agents related to this node. Agents []*ListNodesOKBodyNodesItems0AgentsItems0 `json:"agents"` @@ -596,6 +584,15 @@ type ListNodesOKBodyNodesItems0 struct { // True if this node is a PMM Server node (HA mode). IsPMMServerNode bool `json:"is_pmm_server_node,omitempty"` + + // Node status. + // + // - STATUS_UNSPECIFIED: Invalid status. + // - STATUS_UP: The node is up. + // - STATUS_DOWN: The node is down. + // - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet). + // Enum: ["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` } // Validate validates this list nodes OK body nodes items0 @@ -610,15 +607,15 @@ func (o *ListNodesOKBodyNodesItems0) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateAgents(formats); err != nil { res = append(res, err) } - if err := o.validateAgents(formats); err != nil { + if err := o.validateServices(formats); err != nil { res = append(res, err) } - if err := o.validateServices(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -652,54 +649,6 @@ func (o *ListNodesOKBodyNodesItems0) validateUpdatedAt(formats strfmt.Registry) return nil } -var listNodesOkBodyNodesItems0TypeStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listNodesOkBodyNodesItems0TypeStatusPropEnum = append(listNodesOkBodyNodesItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListNodesOKBodyNodesItems0StatusSTATUSUNSPECIFIED captures enum value "STATUS_UNSPECIFIED" - ListNodesOKBodyNodesItems0StatusSTATUSUNSPECIFIED string = "STATUS_UNSPECIFIED" - - // ListNodesOKBodyNodesItems0StatusSTATUSUP captures enum value "STATUS_UP" - ListNodesOKBodyNodesItems0StatusSTATUSUP string = "STATUS_UP" - - // ListNodesOKBodyNodesItems0StatusSTATUSDOWN captures enum value "STATUS_DOWN" - ListNodesOKBodyNodesItems0StatusSTATUSDOWN string = "STATUS_DOWN" - - // ListNodesOKBodyNodesItems0StatusSTATUSUNKNOWN captures enum value "STATUS_UNKNOWN" - ListNodesOKBodyNodesItems0StatusSTATUSUNKNOWN string = "STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListNodesOKBodyNodesItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listNodesOkBodyNodesItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListNodesOKBodyNodesItems0) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("status", "body", *o.Status); err != nil { - return err - } - - return nil -} - func (o *ListNodesOKBodyNodesItems0) validateAgents(formats strfmt.Registry) error { if swag.IsZero(o.Agents) { // not required return nil @@ -712,15 +661,11 @@ func (o *ListNodesOKBodyNodesItems0) validateAgents(formats strfmt.Registry) err if o.Agents[i] != nil { if err := o.Agents[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("agents" + "." + strconv.Itoa(i)) } - return err } } @@ -742,15 +687,11 @@ func (o *ListNodesOKBodyNodesItems0) validateServices(formats strfmt.Registry) e if o.Services[i] != nil { if err := o.Services[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("services" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("services" + "." + strconv.Itoa(i)) } - return err } } @@ -760,6 +701,54 @@ func (o *ListNodesOKBodyNodesItems0) validateServices(formats strfmt.Registry) e return nil } +var listNodesOkBodyNodesItems0TypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + listNodesOkBodyNodesItems0TypeStatusPropEnum = append(listNodesOkBodyNodesItems0TypeStatusPropEnum, v) + } +} + +const ( + + // ListNodesOKBodyNodesItems0StatusSTATUSUNSPECIFIED captures enum value "STATUS_UNSPECIFIED" + ListNodesOKBodyNodesItems0StatusSTATUSUNSPECIFIED string = "STATUS_UNSPECIFIED" + + // ListNodesOKBodyNodesItems0StatusSTATUSUP captures enum value "STATUS_UP" + ListNodesOKBodyNodesItems0StatusSTATUSUP string = "STATUS_UP" + + // ListNodesOKBodyNodesItems0StatusSTATUSDOWN captures enum value "STATUS_DOWN" + ListNodesOKBodyNodesItems0StatusSTATUSDOWN string = "STATUS_DOWN" + + // ListNodesOKBodyNodesItems0StatusSTATUSUNKNOWN captures enum value "STATUS_UNKNOWN" + ListNodesOKBodyNodesItems0StatusSTATUSUNKNOWN string = "STATUS_UNKNOWN" +) + +// prop value enum +func (o *ListNodesOKBodyNodesItems0) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listNodesOkBodyNodesItems0TypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *ListNodesOKBodyNodesItems0) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("status", "body", *o.Status); err != nil { + return err + } + + return nil +} + // ContextValidate validate this list nodes OK body nodes items0 based on the context it is used func (o *ListNodesOKBodyNodesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -779,7 +768,9 @@ func (o *ListNodesOKBodyNodesItems0) ContextValidate(ctx context.Context, format } func (o *ListNodesOKBodyNodesItems0) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Agents); i++ { + if o.Agents[i] != nil { if swag.IsZero(o.Agents[i]) { // not required @@ -787,25 +778,24 @@ func (o *ListNodesOKBodyNodesItems0) contextValidateAgents(ctx context.Context, } if err := o.Agents[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("agents" + "." + strconv.Itoa(i)) } - return err } } + } return nil } func (o *ListNodesOKBodyNodesItems0) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Services); i++ { + if o.Services[i] != nil { if swag.IsZero(o.Services[i]) { // not required @@ -813,18 +803,15 @@ func (o *ListNodesOKBodyNodesItems0) contextValidateServices(ctx context.Context } if err := o.Services[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("services" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("services" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -853,6 +840,7 @@ ListNodesOKBodyNodesItems0AgentsItems0 list nodes OK body nodes items0 agents it swagger:model ListNodesOKBodyNodesItems0AgentsItems0 */ type ListNodesOKBodyNodesItems0AgentsItems0 struct { + // Unique Agent identifier. AgentID string `json:"agent_id,omitempty"` @@ -899,6 +887,7 @@ ListNodesOKBodyNodesItems0ServicesItems0 Service represents a service running on swagger:model ListNodesOKBodyNodesItems0ServicesItems0 */ type ListNodesOKBodyNodesItems0ServicesItems0 struct { + // Unique Service identifier. ServiceID string `json:"service_id,omitempty"` diff --git a/api/management/v1/json/client/management_service/list_services_parameters.go b/api/management/v1/json/client/management_service/list_services_parameters.go index 80363638efa..d9a1cba1032 100644 --- a/api/management/v1/json/client/management_service/list_services_parameters.go +++ b/api/management/v1/json/client/management_service/list_services_parameters.go @@ -60,6 +60,7 @@ ListServicesParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type ListServicesParams struct { + /* ExternalGroup. Return only services in this external group. @@ -97,7 +98,9 @@ func (o *ListServicesParams) WithDefaults() *ListServicesParams { // // All values with no default are reset to their zero value. func (o *ListServicesParams) SetDefaults() { - serviceTypeDefault := string("SERVICE_TYPE_UNSPECIFIED") + var ( + serviceTypeDefault = string("SERVICE_TYPE_UNSPECIFIED") + ) val := ListServicesParams{ ServiceType: &serviceTypeDefault, @@ -177,6 +180,7 @@ func (o *ListServicesParams) SetServiceType(serviceType *string) { // WriteToRequest writes these params to a swagger request func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } @@ -192,6 +196,7 @@ func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } qExternalGroup := qrExternalGroup if qExternalGroup != "" { + if err := r.SetQueryParam("external_group", qExternalGroup); err != nil { return err } @@ -208,6 +213,7 @@ func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } qNodeID := qrNodeID if qNodeID != "" { + if err := r.SetQueryParam("node_id", qNodeID); err != nil { return err } @@ -224,6 +230,7 @@ func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } qServiceType := qrServiceType if qServiceType != "" { + if err := r.SetQueryParam("service_type", qServiceType); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/list_services_responses.go b/api/management/v1/json/client/management_service/list_services_responses.go index d9fcccd96b2..40507cc7ba7 100644 --- a/api/management/v1/json/client/management_service/list_services_responses.go +++ b/api/management/v1/json/client/management_service/list_services_responses.go @@ -8,7 +8,6 @@ package management_service import ( "context" "encoding/json" - stderrors "errors" "fmt" "io" "strconv" @@ -26,7 +25,7 @@ type ListServicesReader struct { } // ReadResponse reads a server response into the received o. -func (o *ListServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { +func (o *ListServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewListServicesOK() @@ -105,10 +104,11 @@ func (o *ListServicesOK) GetPayload() *ListServicesOKBody { } func (o *ListServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(ListServicesOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -178,10 +178,11 @@ func (o *ListServicesDefault) GetPayload() *ListServicesDefaultBody { } func (o *ListServicesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(ListServicesDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -193,6 +194,7 @@ ListServicesDefaultBody list services default body swagger:model ListServicesDefaultBody */ type ListServicesDefaultBody struct { + // code Code int32 `json:"code,omitempty"` @@ -229,15 +231,11 @@ func (o *ListServicesDefaultBody) validateDetails(formats strfmt.Registry) error if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } @@ -262,7 +260,9 @@ func (o *ListServicesDefaultBody) ContextValidate(ctx context.Context, formats s } func (o *ListServicesDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -270,18 +270,15 @@ func (o *ListServicesDefaultBody) contextValidateDetails(ctx context.Context, fo } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -310,17 +307,19 @@ ListServicesDefaultBodyDetailsItems0 list services default body details items0 swagger:model ListServicesDefaultBodyDetailsItems0 */ type ListServicesDefaultBodyDetailsItems0 struct { + // at type AtType string `json:"@type,omitempty"` // list services default body details items0 - ListServicesDefaultBodyDetailsItems0 map[string]any `json:"-"` + ListServicesDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *ListServicesDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -341,9 +340,9 @@ func (o *ListServicesDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]any) + result := make(map[string]interface{}) for k, v := range stage2 { - var toadd any + var toadd interface{} if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -358,6 +357,7 @@ func (o *ListServicesDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error // MarshalJSON marshals this object with additional properties into a JSON object func (o ListServicesDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -421,6 +421,7 @@ ListServicesOKBody list services OK body swagger:model ListServicesOKBody */ type ListServicesOKBody struct { + // List of Services. Services []*ListServicesOKBodyServicesItems0 `json:"services"` } @@ -451,15 +452,11 @@ func (o *ListServicesOKBody) validateServices(formats strfmt.Registry) error { if o.Services[i] != nil { if err := o.Services[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listServicesOk" + "." + "services" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("listServicesOk" + "." + "services" + "." + strconv.Itoa(i)) } - return err } } @@ -484,7 +481,9 @@ func (o *ListServicesOKBody) ContextValidate(ctx context.Context, formats strfmt } func (o *ListServicesOKBody) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Services); i++ { + if o.Services[i] != nil { if swag.IsZero(o.Services[i]) { // not required @@ -492,18 +491,15 @@ func (o *ListServicesOKBody) contextValidateServices(ctx context.Context, format } if err := o.Services[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listServicesOk" + "." + "services" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("listServicesOk" + "." + "services" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -532,6 +528,7 @@ ListServicesOKBodyServicesItems0 list services OK body services items0 swagger:model ListServicesOKBodyServicesItems0 */ type ListServicesOKBodyServicesItems0 struct { + // Unique service identifier. ServiceID string `json:"service_id,omitempty"` @@ -588,6 +585,9 @@ type ListServicesOKBodyServicesItems0 struct { // List of agents related to this service. Agents []*ListServicesOKBodyServicesItems0AgentsItems0 `json:"agents"` + // The service/database version. + Version string `json:"version,omitempty"` + // Service status. // // - STATUS_UNSPECIFIED: In case we don't support the db vendor yet. @@ -596,9 +596,6 @@ type ListServicesOKBodyServicesItems0 struct { // - STATUS_UNKNOWN: The service's status cannot be known (e.g. there are no metrics yet). // Enum: ["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` - - // The service/database version. - Version string `json:"version,omitempty"` } // Validate validates this list services OK body services items0 @@ -663,15 +660,11 @@ func (o *ListServicesOKBodyServicesItems0) validateAgents(formats strfmt.Registr if o.Agents[i] != nil { if err := o.Agents[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("agents" + "." + strconv.Itoa(i)) } - return err } } @@ -681,7 +674,7 @@ func (o *ListServicesOKBodyServicesItems0) validateAgents(formats strfmt.Registr return nil } -var listServicesOkBodyServicesItems0TypeStatusPropEnum []any +var listServicesOkBodyServicesItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -744,7 +737,9 @@ func (o *ListServicesOKBodyServicesItems0) ContextValidate(ctx context.Context, } func (o *ListServicesOKBodyServicesItems0) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Agents); i++ { + if o.Agents[i] != nil { if swag.IsZero(o.Agents[i]) { // not required @@ -752,18 +747,15 @@ func (o *ListServicesOKBodyServicesItems0) contextValidateAgents(ctx context.Con } if err := o.Agents[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("agents" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -792,6 +784,7 @@ ListServicesOKBodyServicesItems0AgentsItems0 list services OK body services item swagger:model ListServicesOKBodyServicesItems0AgentsItems0 */ type ListServicesOKBodyServicesItems0AgentsItems0 struct { + // Unique agent identifier. AgentID string `json:"agent_id,omitempty"` @@ -823,12 +816,6 @@ type ListServicesOKBodyServicesItems0AgentsItems0 struct { // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // Limit query length in QAN. MaxQueryLength int32 `json:"max_query_length,omitempty"` @@ -907,12 +894,15 @@ type ListServicesOKBodyServicesItems0AgentsItems0 struct { // True if an exporter agent is exposed on all host addresses. ExposeExporter bool `json:"expose_exporter,omitempty"` - // valkey options - ValkeyOptions any `json:"valkey_options,omitempty"` - // azure options AzureOptions *ListServicesOKBodyServicesItems0AgentsItems0AzureOptions `json:"azure_options,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // mongo db options MongoDBOptions *ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions `json:"mongo_db_options,omitempty"` @@ -924,6 +914,9 @@ type ListServicesOKBodyServicesItems0AgentsItems0 struct { // rta options RtaOptions *ListServicesOKBodyServicesItems0AgentsItems0RtaOptions `json:"rta_options,omitempty"` + + // valkey options + ValkeyOptions interface{} `json:"valkey_options,omitempty"` } // Validate validates this list services OK body services items0 agents items0 @@ -934,15 +927,15 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) Validate(formats strfmt.R res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateUpdatedAt(formats); err != nil { res = append(res, err) } - if err := o.validateUpdatedAt(formats); err != nil { + if err := o.validateAzureOptions(formats); err != nil { res = append(res, err) } - if err := o.validateAzureOptions(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } @@ -980,7 +973,38 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateCreatedAt(formats return nil } -var listServicesOkBodyServicesItems0AgentsItems0TypeLogLevelPropEnum []any +func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(o.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updated_at", "body", "date-time", o.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateAzureOptions(formats strfmt.Registry) error { + if swag.IsZero(o.AzureOptions) { // not required + return nil + } + + if o.AzureOptions != nil { + if err := o.AzureOptions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("azure_options") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("azure_options") + } + return err + } + } + + return nil +} + +var listServicesOkBodyServicesItems0AgentsItems0TypeLogLevelPropEnum []interface{} func init() { var res []string @@ -1034,41 +1058,6 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateLogLevel(formats return nil } -func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updated_at", "body", "date-time", o.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateAzureOptions(formats strfmt.Registry) error { - if swag.IsZero(o.AzureOptions) { // not required - return nil - } - - if o.AzureOptions != nil { - if err := o.AzureOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("azure_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("azure_options") - } - - return err - } - } - - return nil -} - func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateMongoDBOptions(formats strfmt.Registry) error { if swag.IsZero(o.MongoDBOptions) { // not required return nil @@ -1076,15 +1065,11 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateMongoDBOptions(fo if o.MongoDBOptions != nil { if err := o.MongoDBOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mongo_db_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("mongo_db_options") } - return err } } @@ -1099,15 +1084,11 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateMysqlOptions(form if o.MysqlOptions != nil { if err := o.MysqlOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mysql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("mysql_options") } - return err } } @@ -1122,15 +1103,11 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) validatePostgresqlOptions if o.PostgresqlOptions != nil { if err := o.PostgresqlOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("postgresql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("postgresql_options") } - return err } } @@ -1145,15 +1122,11 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateRtaOptions(format if o.RtaOptions != nil { if err := o.RtaOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("rta_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("rta_options") } - return err } } @@ -1192,6 +1165,7 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) ContextValidate(ctx conte } func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateAzureOptions(ctx context.Context, formats strfmt.Registry) error { + if o.AzureOptions != nil { if swag.IsZero(o.AzureOptions) { // not required @@ -1199,15 +1173,11 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateAzureOptio } if err := o.AzureOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("azure_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("azure_options") } - return err } } @@ -1216,6 +1186,7 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateAzureOptio } func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateMongoDBOptions(ctx context.Context, formats strfmt.Registry) error { + if o.MongoDBOptions != nil { if swag.IsZero(o.MongoDBOptions) { // not required @@ -1223,15 +1194,11 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateMongoDBOpt } if err := o.MongoDBOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mongo_db_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("mongo_db_options") } - return err } } @@ -1240,6 +1207,7 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateMongoDBOpt } func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateMysqlOptions(ctx context.Context, formats strfmt.Registry) error { + if o.MysqlOptions != nil { if swag.IsZero(o.MysqlOptions) { // not required @@ -1247,15 +1215,11 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateMysqlOptio } if err := o.MysqlOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mysql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("mysql_options") } - return err } } @@ -1264,6 +1228,7 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateMysqlOptio } func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidatePostgresqlOptions(ctx context.Context, formats strfmt.Registry) error { + if o.PostgresqlOptions != nil { if swag.IsZero(o.PostgresqlOptions) { // not required @@ -1271,15 +1236,11 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidatePostgresql } if err := o.PostgresqlOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("postgresql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("postgresql_options") } - return err } } @@ -1288,6 +1249,7 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidatePostgresql } func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateRtaOptions(ctx context.Context, formats strfmt.Registry) error { + if o.RtaOptions != nil { if swag.IsZero(o.RtaOptions) { // not required @@ -1295,15 +1257,11 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateRtaOptions } if err := o.RtaOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("rta_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("rta_options") } - return err } } @@ -1334,6 +1292,7 @@ ListServicesOKBodyServicesItems0AgentsItems0AzureOptions list services OK body s swagger:model ListServicesOKBodyServicesItems0AgentsItems0AzureOptions */ type ListServicesOKBodyServicesItems0AgentsItems0AzureOptions struct { + // Azure client ID. ClientID string `json:"client_id,omitempty"` @@ -1383,6 +1342,7 @@ ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions list services OK body swagger:model ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions */ type ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions struct { + // True if TLS certificate is set. IsTLSCertificateKeySet bool `json:"is_tls_certificate_key_set,omitempty"` @@ -1438,6 +1398,7 @@ ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions list services OK body s swagger:model ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions */ type ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions struct { + // True if TLS key is set. IsTLSKeySet bool `json:"is_tls_key_set,omitempty"` @@ -1478,6 +1439,7 @@ ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions list services OK b swagger:model ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions */ type ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions struct { + // True if TLS key is set. IsSslKeySet bool `json:"is_ssl_key_set,omitempty"` @@ -1521,6 +1483,7 @@ ListServicesOKBodyServicesItems0AgentsItems0RtaOptions RTAOptions holds Real-Tim swagger:model ListServicesOKBodyServicesItems0AgentsItems0RtaOptions */ type ListServicesOKBodyServicesItems0AgentsItems0RtaOptions struct { + // Query collect interval (default 2s is set by server). CollectInterval string `json:"collect_interval,omitempty"` } diff --git a/api/management/v1/json/client/management_service/management_service_client.go b/api/management/v1/json/client/management_service/management_service_client.go index febfb2dbe2a..86f82f40fe2 100644 --- a/api/management/v1/json/client/management_service/management_service_client.go +++ b/api/management/v1/json/client/management_service/management_service_client.go @@ -60,6 +60,8 @@ type ClientService interface { AddService(params *AddServiceParams, opts ...ClientOption) (*AddServiceOK, error) + CreateNodeInstallToken(params *CreateNodeInstallTokenParams, opts ...ClientOption) (*CreateNodeInstallTokenOK, error) + DiscoverAzureDatabase(params *DiscoverAzureDatabaseParams, opts ...ClientOption) (*DiscoverAzureDatabaseOK, error) DiscoverRDS(params *DiscoverRDSParams, opts ...ClientOption) (*DiscoverRDSOK, error) @@ -89,7 +91,7 @@ AddAnnotation adds an annotation Adds an annotation. */ func (a *Client) AddAnnotation(params *AddAnnotationParams, opts ...ClientOption) (*AddAnnotationOK, error) { - // NOTE: parameters are not validated before sending + // TODO: Validate the params before sending if params == nil { params = NewAddAnnotationParams() } @@ -108,22 +110,17 @@ func (a *Client) AddAnnotation(params *AddAnnotationParams, opts ...ClientOption for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) if err != nil { return nil, err } - - // only one success response has to be checked success, ok := result.(*AddAnnotationOK) if ok { return success, nil } - - // unexpected success response. - // - // a default response is provided: fill this and return an error + // unexpected success response unexpectedSuccess := result.(*AddAnnotationDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -133,7 +130,7 @@ AddAzureDatabase adds azure database Adds an Azure Database instance. */ func (a *Client) AddAzureDatabase(params *AddAzureDatabaseParams, opts ...ClientOption) (*AddAzureDatabaseOK, error) { - // NOTE: parameters are not validated before sending + // TODO: Validate the params before sending if params == nil { params = NewAddAzureDatabaseParams() } @@ -152,22 +149,17 @@ func (a *Client) AddAzureDatabase(params *AddAzureDatabaseParams, opts ...Client for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) if err != nil { return nil, err } - - // only one success response has to be checked success, ok := result.(*AddAzureDatabaseOK) if ok { return success, nil } - - // unexpected success response. - // - // a default response is provided: fill this and return an error + // unexpected success response unexpectedSuccess := result.(*AddAzureDatabaseDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -177,7 +169,7 @@ AddService adds a service Adds a service and starts several agents. */ func (a *Client) AddService(params *AddServiceParams, opts ...ClientOption) (*AddServiceOK, error) { - // NOTE: parameters are not validated before sending + // TODO: Validate the params before sending if params == nil { params = NewAddServiceParams() } @@ -196,22 +188,56 @@ func (a *Client) AddService(params *AddServiceParams, opts ...ClientOption) (*Ad for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) if err != nil { return nil, err } - - // only one success response has to be checked success, ok := result.(*AddServiceOK) if ok { return success, nil } - - // unexpected success response. - // - // a default response is provided: fill this and return an error + // unexpected success response unexpectedSuccess := result.(*AddServiceDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CreateNodeInstallToken creates node install token + +Creates a short-lived Grafana service account token for PMM Client install. +*/ +func (a *Client) CreateNodeInstallToken(params *CreateNodeInstallTokenParams, opts ...ClientOption) (*CreateNodeInstallTokenOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateNodeInstallTokenParams() + } + op := &runtime.ClientOperation{ + ID: "CreateNodeInstallToken", + Method: "POST", + PathPattern: "/v1/management/nodes:installToken", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &CreateNodeInstallTokenReader{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.(*CreateNodeInstallTokenOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateNodeInstallTokenDefault) return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -221,7 +247,7 @@ DiscoverAzureDatabase discovers azure database Discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances. */ func (a *Client) DiscoverAzureDatabase(params *DiscoverAzureDatabaseParams, opts ...ClientOption) (*DiscoverAzureDatabaseOK, error) { - // NOTE: parameters are not validated before sending + // TODO: Validate the params before sending if params == nil { params = NewDiscoverAzureDatabaseParams() } @@ -240,22 +266,17 @@ func (a *Client) DiscoverAzureDatabase(params *DiscoverAzureDatabaseParams, opts for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) if err != nil { return nil, err } - - // only one success response has to be checked success, ok := result.(*DiscoverAzureDatabaseOK) if ok { return success, nil } - - // unexpected success response. - // - // a default response is provided: fill this and return an error + // unexpected success response unexpectedSuccess := result.(*DiscoverAzureDatabaseDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -265,7 +286,7 @@ DiscoverRDS discovers RDS Discovers RDS instances. */ func (a *Client) DiscoverRDS(params *DiscoverRDSParams, opts ...ClientOption) (*DiscoverRDSOK, error) { - // NOTE: parameters are not validated before sending + // TODO: Validate the params before sending if params == nil { params = NewDiscoverRDSParams() } @@ -284,22 +305,17 @@ func (a *Client) DiscoverRDS(params *DiscoverRDSParams, opts ...ClientOption) (* for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) if err != nil { return nil, err } - - // only one success response has to be checked success, ok := result.(*DiscoverRDSOK) if ok { return success, nil } - - // unexpected success response. - // - // a default response is provided: fill this and return an error + // unexpected success response unexpectedSuccess := result.(*DiscoverRDSDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -309,7 +325,7 @@ GetNode gets node Gets a single Node by ID. */ func (a *Client) GetNode(params *GetNodeParams, opts ...ClientOption) (*GetNodeOK, error) { - // NOTE: parameters are not validated before sending + // TODO: Validate the params before sending if params == nil { params = NewGetNodeParams() } @@ -328,22 +344,17 @@ func (a *Client) GetNode(params *GetNodeParams, opts ...ClientOption) (*GetNodeO for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) if err != nil { return nil, err } - - // only one success response has to be checked success, ok := result.(*GetNodeOK) if ok { return success, nil } - - // unexpected success response. - // - // a default response is provided: fill this and return an error + // unexpected success response unexpectedSuccess := result.(*GetNodeDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -353,7 +364,7 @@ ListAgentVersions lists agent versions Lists Agent versions and their update severity. */ func (a *Client) ListAgentVersions(params *ListAgentVersionsParams, opts ...ClientOption) (*ListAgentVersionsOK, error) { - // NOTE: parameters are not validated before sending + // TODO: Validate the params before sending if params == nil { params = NewListAgentVersionsParams() } @@ -372,22 +383,17 @@ func (a *Client) ListAgentVersions(params *ListAgentVersionsParams, opts ...Clie for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) if err != nil { return nil, err } - - // only one success response has to be checked success, ok := result.(*ListAgentVersionsOK) if ok { return success, nil } - - // unexpected success response. - // - // a default response is provided: fill this and return an error + // unexpected success response unexpectedSuccess := result.(*ListAgentVersionsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -397,7 +403,7 @@ ListAgents lists agents Lists Agents with filter. */ func (a *Client) ListAgents(params *ListAgentsParams, opts ...ClientOption) (*ListAgentsOK, error) { - // NOTE: parameters are not validated before sending + // TODO: Validate the params before sending if params == nil { params = NewListAgentsParams() } @@ -416,22 +422,17 @@ func (a *Client) ListAgents(params *ListAgentsParams, opts ...ClientOption) (*Li for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) if err != nil { return nil, err } - - // only one success response has to be checked success, ok := result.(*ListAgentsOK) if ok { return success, nil } - - // unexpected success response. - // - // a default response is provided: fill this and return an error + // unexpected success response unexpectedSuccess := result.(*ListAgentsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -441,7 +442,7 @@ ListNodes lists nodes Lists Nodes with filter. */ func (a *Client) ListNodes(params *ListNodesParams, opts ...ClientOption) (*ListNodesOK, error) { - // NOTE: parameters are not validated before sending + // TODO: Validate the params before sending if params == nil { params = NewListNodesParams() } @@ -460,22 +461,17 @@ func (a *Client) ListNodes(params *ListNodesParams, opts ...ClientOption) (*List for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) if err != nil { return nil, err } - - // only one success response has to be checked success, ok := result.(*ListNodesOK) if ok { return success, nil } - - // unexpected success response. - // - // a default response is provided: fill this and return an error + // unexpected success response unexpectedSuccess := result.(*ListNodesDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -485,7 +481,7 @@ ListServices lists services Returns a filtered list of Services. */ func (a *Client) ListServices(params *ListServicesParams, opts ...ClientOption) (*ListServicesOK, error) { - // NOTE: parameters are not validated before sending + // TODO: Validate the params before sending if params == nil { params = NewListServicesParams() } @@ -504,22 +500,17 @@ func (a *Client) ListServices(params *ListServicesParams, opts ...ClientOption) for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) if err != nil { return nil, err } - - // only one success response has to be checked success, ok := result.(*ListServicesOK) if ok { return success, nil } - - // unexpected success response. - // - // a default response is provided: fill this and return an error + // unexpected success response unexpectedSuccess := result.(*ListServicesDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -529,7 +520,7 @@ RegisterNode registers a node Registers a new Node and a pmm-agent. */ func (a *Client) RegisterNode(params *RegisterNodeParams, opts ...ClientOption) (*RegisterNodeOK, error) { - // NOTE: parameters are not validated before sending + // TODO: Validate the params before sending if params == nil { params = NewRegisterNodeParams() } @@ -548,22 +539,17 @@ func (a *Client) RegisterNode(params *RegisterNodeParams, opts ...ClientOption) for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) if err != nil { return nil, err } - - // only one success response has to be checked success, ok := result.(*RegisterNodeOK) if ok { return success, nil } - - // unexpected success response. - // - // a default response is provided: fill this and return an error + // unexpected success response unexpectedSuccess := result.(*RegisterNodeDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -573,7 +559,7 @@ RemoveService removes a service Removes a Service along with its Agents. */ func (a *Client) RemoveService(params *RemoveServiceParams, opts ...ClientOption) (*RemoveServiceOK, error) { - // NOTE: parameters are not validated before sending + // TODO: Validate the params before sending if params == nil { params = NewRemoveServiceParams() } @@ -592,22 +578,17 @@ func (a *Client) RemoveService(params *RemoveServiceParams, opts ...ClientOption for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) if err != nil { return nil, err } - - // only one success response has to be checked success, ok := result.(*RemoveServiceOK) if ok { return success, nil } - - // unexpected success response. - // - // a default response is provided: fill this and return an error + // unexpected success response unexpectedSuccess := result.(*RemoveServiceDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -617,7 +598,7 @@ UnregisterNode unregisters a node Unregisters a Node and pmm-agent */ func (a *Client) UnregisterNode(params *UnregisterNodeParams, opts ...ClientOption) (*UnregisterNodeOK, error) { - // NOTE: parameters are not validated before sending + // TODO: Validate the params before sending if params == nil { params = NewUnregisterNodeParams() } @@ -636,22 +617,17 @@ func (a *Client) UnregisterNode(params *UnregisterNodeParams, opts ...ClientOpti for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) if err != nil { return nil, err } - - // only one success response has to be checked success, ok := result.(*UnregisterNodeOK) if ok { return success, nil } - - // unexpected success response. - // - // a default response is provided: fill this and return an error + // unexpected success response unexpectedSuccess := result.(*UnregisterNodeDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } diff --git a/api/management/v1/json/client/management_service/register_node_parameters.go b/api/management/v1/json/client/management_service/register_node_parameters.go index a614118a70b..5de06b5b324 100644 --- a/api/management/v1/json/client/management_service/register_node_parameters.go +++ b/api/management/v1/json/client/management_service/register_node_parameters.go @@ -60,6 +60,7 @@ RegisterNodeParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type RegisterNodeParams struct { + // Body. Body RegisterNodeBody @@ -129,6 +130,7 @@ func (o *RegisterNodeParams) SetBody(body RegisterNodeBody) { // WriteToRequest writes these params to a swagger request func (o *RegisterNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/register_node_responses.go b/api/management/v1/json/client/management_service/register_node_responses.go index f4c682e05e9..5aed0ea3aa0 100644 --- a/api/management/v1/json/client/management_service/register_node_responses.go +++ b/api/management/v1/json/client/management_service/register_node_responses.go @@ -8,7 +8,6 @@ package management_service import ( "context" "encoding/json" - stderrors "errors" "fmt" "io" "strconv" @@ -26,7 +25,7 @@ type RegisterNodeReader struct { } // ReadResponse reads a server response into the received o. -func (o *RegisterNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { +func (o *RegisterNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewRegisterNodeOK() @@ -105,10 +104,11 @@ func (o *RegisterNodeOK) GetPayload() *RegisterNodeOKBody { } func (o *RegisterNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(RegisterNodeOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -178,10 +178,11 @@ func (o *RegisterNodeDefault) GetPayload() *RegisterNodeDefaultBody { } func (o *RegisterNodeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(RegisterNodeDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -193,9 +194,6 @@ RegisterNodeBody register node body swagger:model RegisterNodeBody */ type RegisterNodeBody struct { - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` // A user-defined name unique across all Nodes. NodeName string `json:"node_name,omitempty"` @@ -230,13 +228,6 @@ type RegisterNodeBody struct { // If true, and Node with that name already exist, it will be removed with all dependent Services and Agents. Reregister bool `json:"reregister,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` @@ -248,17 +239,28 @@ type RegisterNodeBody struct { // AWS instance ID. InstanceID string `json:"instance_id,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` + + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this register node body func (o *RegisterNodeBody) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateNodeType(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateNodeType(formats); err != nil { res = append(res, err) } @@ -268,99 +270,99 @@ func (o *RegisterNodeBody) Validate(formats strfmt.Registry) error { return nil } -var registerNodeBodyTypeNodeTypePropEnum []any +var registerNodeBodyTypeMetricsModePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { panic(err) } for _, v := range res { - registerNodeBodyTypeNodeTypePropEnum = append(registerNodeBodyTypeNodeTypePropEnum, v) + registerNodeBodyTypeMetricsModePropEnum = append(registerNodeBodyTypeMetricsModePropEnum, v) } } const ( - // RegisterNodeBodyNodeTypeNODETYPEUNSPECIFIED captures enum value "NODE_TYPE_UNSPECIFIED" - RegisterNodeBodyNodeTypeNODETYPEUNSPECIFIED string = "NODE_TYPE_UNSPECIFIED" - - // RegisterNodeBodyNodeTypeNODETYPEGENERICNODE captures enum value "NODE_TYPE_GENERIC_NODE" - RegisterNodeBodyNodeTypeNODETYPEGENERICNODE string = "NODE_TYPE_GENERIC_NODE" - - // RegisterNodeBodyNodeTypeNODETYPECONTAINERNODE captures enum value "NODE_TYPE_CONTAINER_NODE" - RegisterNodeBodyNodeTypeNODETYPECONTAINERNODE string = "NODE_TYPE_CONTAINER_NODE" - - // RegisterNodeBodyNodeTypeNODETYPEREMOTENODE captures enum value "NODE_TYPE_REMOTE_NODE" - RegisterNodeBodyNodeTypeNODETYPEREMOTENODE string = "NODE_TYPE_REMOTE_NODE" + // RegisterNodeBodyMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" + RegisterNodeBodyMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - // RegisterNodeBodyNodeTypeNODETYPEREMOTERDSNODE captures enum value "NODE_TYPE_REMOTE_RDS_NODE" - RegisterNodeBodyNodeTypeNODETYPEREMOTERDSNODE string = "NODE_TYPE_REMOTE_RDS_NODE" + // RegisterNodeBodyMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" + RegisterNodeBodyMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - // RegisterNodeBodyNodeTypeNODETYPEREMOTEAZUREDATABASENODE captures enum value "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - RegisterNodeBodyNodeTypeNODETYPEREMOTEAZUREDATABASENODE string = "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + // RegisterNodeBodyMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" + RegisterNodeBodyMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" ) // prop value enum -func (o *RegisterNodeBody) validateNodeTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, registerNodeBodyTypeNodeTypePropEnum, true); err != nil { +func (o *RegisterNodeBody) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, registerNodeBodyTypeMetricsModePropEnum, true); err != nil { return err } return nil } -func (o *RegisterNodeBody) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required +func (o *RegisterNodeBody) validateMetricsMode(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsMode) { // not required return nil } // value enum - if err := o.validateNodeTypeEnum("body"+"."+"node_type", "body", *o.NodeType); err != nil { + if err := o.validateMetricsModeEnum("body"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { return err } return nil } -var registerNodeBodyTypeMetricsModePropEnum []any +var registerNodeBodyTypeNodeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"]`), &res); err != nil { panic(err) } for _, v := range res { - registerNodeBodyTypeMetricsModePropEnum = append(registerNodeBodyTypeMetricsModePropEnum, v) + registerNodeBodyTypeNodeTypePropEnum = append(registerNodeBodyTypeNodeTypePropEnum, v) } } const ( - // RegisterNodeBodyMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - RegisterNodeBodyMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" + // RegisterNodeBodyNodeTypeNODETYPEUNSPECIFIED captures enum value "NODE_TYPE_UNSPECIFIED" + RegisterNodeBodyNodeTypeNODETYPEUNSPECIFIED string = "NODE_TYPE_UNSPECIFIED" - // RegisterNodeBodyMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - RegisterNodeBodyMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" + // RegisterNodeBodyNodeTypeNODETYPEGENERICNODE captures enum value "NODE_TYPE_GENERIC_NODE" + RegisterNodeBodyNodeTypeNODETYPEGENERICNODE string = "NODE_TYPE_GENERIC_NODE" - // RegisterNodeBodyMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - RegisterNodeBodyMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" + // RegisterNodeBodyNodeTypeNODETYPECONTAINERNODE captures enum value "NODE_TYPE_CONTAINER_NODE" + RegisterNodeBodyNodeTypeNODETYPECONTAINERNODE string = "NODE_TYPE_CONTAINER_NODE" + + // RegisterNodeBodyNodeTypeNODETYPEREMOTENODE captures enum value "NODE_TYPE_REMOTE_NODE" + RegisterNodeBodyNodeTypeNODETYPEREMOTENODE string = "NODE_TYPE_REMOTE_NODE" + + // RegisterNodeBodyNodeTypeNODETYPEREMOTERDSNODE captures enum value "NODE_TYPE_REMOTE_RDS_NODE" + RegisterNodeBodyNodeTypeNODETYPEREMOTERDSNODE string = "NODE_TYPE_REMOTE_RDS_NODE" + + // RegisterNodeBodyNodeTypeNODETYPEREMOTEAZUREDATABASENODE captures enum value "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + RegisterNodeBodyNodeTypeNODETYPEREMOTEAZUREDATABASENODE string = "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" ) // prop value enum -func (o *RegisterNodeBody) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, registerNodeBodyTypeMetricsModePropEnum, true); err != nil { +func (o *RegisterNodeBody) validateNodeTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, registerNodeBodyTypeNodeTypePropEnum, true); err != nil { return err } return nil } -func (o *RegisterNodeBody) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required +func (o *RegisterNodeBody) validateNodeType(formats strfmt.Registry) error { + if swag.IsZero(o.NodeType) { // not required return nil } // value enum - if err := o.validateMetricsModeEnum("body"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + if err := o.validateNodeTypeEnum("body"+"."+"node_type", "body", *o.NodeType); err != nil { return err } @@ -395,6 +397,7 @@ RegisterNodeDefaultBody register node default body swagger:model RegisterNodeDefaultBody */ type RegisterNodeDefaultBody struct { + // code Code int32 `json:"code,omitempty"` @@ -431,15 +434,11 @@ func (o *RegisterNodeDefaultBody) validateDetails(formats strfmt.Registry) error if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } @@ -464,7 +463,9 @@ func (o *RegisterNodeDefaultBody) ContextValidate(ctx context.Context, formats s } func (o *RegisterNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -472,18 +473,15 @@ func (o *RegisterNodeDefaultBody) contextValidateDetails(ctx context.Context, fo } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -512,17 +510,19 @@ RegisterNodeDefaultBodyDetailsItems0 register node default body details items0 swagger:model RegisterNodeDefaultBodyDetailsItems0 */ type RegisterNodeDefaultBodyDetailsItems0 struct { + // at type AtType string `json:"@type,omitempty"` // register node default body details items0 - RegisterNodeDefaultBodyDetailsItems0 map[string]any `json:"-"` + RegisterNodeDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *RegisterNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -543,9 +543,9 @@ func (o *RegisterNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]any) + result := make(map[string]interface{}) for k, v := range stage2 { - var toadd any + var toadd interface{} if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -560,6 +560,7 @@ func (o *RegisterNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error // MarshalJSON marshals this object with additional properties into a JSON object func (o RegisterNodeDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -623,6 +624,7 @@ RegisterNodeOKBody register node OK body swagger:model RegisterNodeOKBody */ type RegisterNodeOKBody struct { + // Token represents token for vmagent auth config. Token string `json:"token,omitempty"` @@ -668,15 +670,11 @@ func (o *RegisterNodeOKBody) validateContainerNode(formats strfmt.Registry) erro if o.ContainerNode != nil { if err := o.ContainerNode.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("registerNodeOk" + "." + "container_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("registerNodeOk" + "." + "container_node") } - return err } } @@ -691,15 +689,11 @@ func (o *RegisterNodeOKBody) validateGenericNode(formats strfmt.Registry) error if o.GenericNode != nil { if err := o.GenericNode.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("registerNodeOk" + "." + "generic_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("registerNodeOk" + "." + "generic_node") } - return err } } @@ -714,15 +708,11 @@ func (o *RegisterNodeOKBody) validatePMMAgent(formats strfmt.Registry) error { if o.PMMAgent != nil { if err := o.PMMAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("registerNodeOk" + "." + "pmm_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("registerNodeOk" + "." + "pmm_agent") } - return err } } @@ -753,6 +743,7 @@ func (o *RegisterNodeOKBody) ContextValidate(ctx context.Context, formats strfmt } func (o *RegisterNodeOKBody) contextValidateContainerNode(ctx context.Context, formats strfmt.Registry) error { + if o.ContainerNode != nil { if swag.IsZero(o.ContainerNode) { // not required @@ -760,15 +751,11 @@ func (o *RegisterNodeOKBody) contextValidateContainerNode(ctx context.Context, f } if err := o.ContainerNode.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("registerNodeOk" + "." + "container_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("registerNodeOk" + "." + "container_node") } - return err } } @@ -777,6 +764,7 @@ func (o *RegisterNodeOKBody) contextValidateContainerNode(ctx context.Context, f } func (o *RegisterNodeOKBody) contextValidateGenericNode(ctx context.Context, formats strfmt.Registry) error { + if o.GenericNode != nil { if swag.IsZero(o.GenericNode) { // not required @@ -784,15 +772,11 @@ func (o *RegisterNodeOKBody) contextValidateGenericNode(ctx context.Context, for } if err := o.GenericNode.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("registerNodeOk" + "." + "generic_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("registerNodeOk" + "." + "generic_node") } - return err } } @@ -801,6 +785,7 @@ func (o *RegisterNodeOKBody) contextValidateGenericNode(ctx context.Context, for } func (o *RegisterNodeOKBody) contextValidatePMMAgent(ctx context.Context, formats strfmt.Registry) error { + if o.PMMAgent != nil { if swag.IsZero(o.PMMAgent) { // not required @@ -808,15 +793,11 @@ func (o *RegisterNodeOKBody) contextValidatePMMAgent(ctx context.Context, format } if err := o.PMMAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("registerNodeOk" + "." + "pmm_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("registerNodeOk" + "." + "pmm_agent") } - return err } } @@ -847,6 +828,7 @@ RegisterNodeOKBodyContainerNode ContainerNode represents a Docker container. swagger:model RegisterNodeOKBodyContainerNode */ type RegisterNodeOKBodyContainerNode struct { + // Unique randomly generated instance identifier. NodeID string `json:"node_id,omitempty"` @@ -914,6 +896,7 @@ RegisterNodeOKBodyGenericNode GenericNode represents a bare metal server or virt swagger:model RegisterNodeOKBodyGenericNode */ type RegisterNodeOKBodyGenericNode struct { + // Unique randomly generated instance identifier. NodeID string `json:"node_id,omitempty"` @@ -978,6 +961,7 @@ RegisterNodeOKBodyPMMAgent PMMAgent runs on Generic or Container Node. swagger:model RegisterNodeOKBodyPMMAgent */ type RegisterNodeOKBodyPMMAgent struct { + // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` diff --git a/api/management/v1/json/client/management_service/remove_service_parameters.go b/api/management/v1/json/client/management_service/remove_service_parameters.go index 16511c1b2e4..7700f224248 100644 --- a/api/management/v1/json/client/management_service/remove_service_parameters.go +++ b/api/management/v1/json/client/management_service/remove_service_parameters.go @@ -60,6 +60,7 @@ RemoveServiceParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type RemoveServiceParams struct { + /* ServiceID. Either a Service ID or a Service Name. @@ -91,7 +92,9 @@ func (o *RemoveServiceParams) WithDefaults() *RemoveServiceParams { // // All values with no default are reset to their zero value. func (o *RemoveServiceParams) SetDefaults() { - serviceTypeDefault := string("SERVICE_TYPE_UNSPECIFIED") + var ( + serviceTypeDefault = string("SERVICE_TYPE_UNSPECIFIED") + ) val := RemoveServiceParams{ ServiceType: &serviceTypeDefault, @@ -160,6 +163,7 @@ func (o *RemoveServiceParams) SetServiceType(serviceType *string) { // WriteToRequest writes these params to a swagger request func (o *RemoveServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } @@ -180,6 +184,7 @@ func (o *RemoveServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } qServiceType := qrServiceType if qServiceType != "" { + if err := r.SetQueryParam("service_type", qServiceType); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/remove_service_responses.go b/api/management/v1/json/client/management_service/remove_service_responses.go index b9b54fc46ba..d413afd47f3 100644 --- a/api/management/v1/json/client/management_service/remove_service_responses.go +++ b/api/management/v1/json/client/management_service/remove_service_responses.go @@ -8,7 +8,6 @@ package management_service import ( "context" "encoding/json" - stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +24,7 @@ type RemoveServiceReader struct { } // ReadResponse reads a server response into the received o. -func (o *RemoveServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { +func (o *RemoveServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewRemoveServiceOK() @@ -56,7 +55,7 @@ RemoveServiceOK describes a response with status code 200, with default header v A successful response. */ type RemoveServiceOK struct { - Payload any + Payload interface{} } // IsSuccess returns true when this remove service Ok response has a 2xx status code @@ -99,13 +98,14 @@ func (o *RemoveServiceOK) String() string { return fmt.Sprintf("[DELETE /v1/management/services/{service_id}][%d] removeServiceOk %s", 200, payload) } -func (o *RemoveServiceOK) GetPayload() any { +func (o *RemoveServiceOK) GetPayload() interface{} { return o.Payload } func (o *RemoveServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } @@ -175,10 +175,11 @@ func (o *RemoveServiceDefault) GetPayload() *RemoveServiceDefaultBody { } func (o *RemoveServiceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(RemoveServiceDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -190,6 +191,7 @@ RemoveServiceDefaultBody remove service default body swagger:model RemoveServiceDefaultBody */ type RemoveServiceDefaultBody struct { + // code Code int32 `json:"code,omitempty"` @@ -226,15 +228,11 @@ func (o *RemoveServiceDefaultBody) validateDetails(formats strfmt.Registry) erro if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } @@ -259,7 +257,9 @@ func (o *RemoveServiceDefaultBody) ContextValidate(ctx context.Context, formats } func (o *RemoveServiceDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -267,18 +267,15 @@ func (o *RemoveServiceDefaultBody) contextValidateDetails(ctx context.Context, f } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -307,17 +304,19 @@ RemoveServiceDefaultBodyDetailsItems0 remove service default body details items0 swagger:model RemoveServiceDefaultBodyDetailsItems0 */ type RemoveServiceDefaultBodyDetailsItems0 struct { + // at type AtType string `json:"@type,omitempty"` // remove service default body details items0 - RemoveServiceDefaultBodyDetailsItems0 map[string]any `json:"-"` + RemoveServiceDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *RemoveServiceDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -338,9 +337,9 @@ func (o *RemoveServiceDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]any) + result := make(map[string]interface{}) for k, v := range stage2 { - var toadd any + var toadd interface{} if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -355,6 +354,7 @@ func (o *RemoveServiceDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error // MarshalJSON marshals this object with additional properties into a JSON object func (o RemoveServiceDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } diff --git a/api/management/v1/json/client/management_service/unregister_node_parameters.go b/api/management/v1/json/client/management_service/unregister_node_parameters.go index 069530e44b2..21d279574a5 100644 --- a/api/management/v1/json/client/management_service/unregister_node_parameters.go +++ b/api/management/v1/json/client/management_service/unregister_node_parameters.go @@ -61,6 +61,7 @@ UnregisterNodeParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type UnregisterNodeParams struct { + /* Force. Force delete node, related service account, even if it has more service tokens attached. @@ -150,6 +151,7 @@ func (o *UnregisterNodeParams) SetNodeID(nodeID string) { // WriteToRequest writes these params to a swagger request func (o *UnregisterNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } @@ -165,6 +167,7 @@ func (o *UnregisterNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfm } qForce := swag.FormatBool(qrForce) if qForce != "" { + if err := r.SetQueryParam("force", qForce); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/unregister_node_responses.go b/api/management/v1/json/client/management_service/unregister_node_responses.go index a935e26136f..8204d24e157 100644 --- a/api/management/v1/json/client/management_service/unregister_node_responses.go +++ b/api/management/v1/json/client/management_service/unregister_node_responses.go @@ -8,7 +8,6 @@ package management_service import ( "context" "encoding/json" - stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +24,7 @@ type UnregisterNodeReader struct { } // ReadResponse reads a server response into the received o. -func (o *UnregisterNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { +func (o *UnregisterNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewUnregisterNodeOK() @@ -104,10 +103,11 @@ func (o *UnregisterNodeOK) GetPayload() *UnregisterNodeOKBody { } func (o *UnregisterNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(UnregisterNodeOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -177,10 +177,11 @@ func (o *UnregisterNodeDefault) GetPayload() *UnregisterNodeDefaultBody { } func (o *UnregisterNodeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(UnregisterNodeDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } @@ -192,6 +193,7 @@ UnregisterNodeDefaultBody unregister node default body swagger:model UnregisterNodeDefaultBody */ type UnregisterNodeDefaultBody struct { + // code Code int32 `json:"code,omitempty"` @@ -228,15 +230,11 @@ func (o *UnregisterNodeDefaultBody) validateDetails(formats strfmt.Registry) err if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("UnregisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("UnregisterNode default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } @@ -261,7 +259,9 @@ func (o *UnregisterNodeDefaultBody) ContextValidate(ctx context.Context, formats } func (o *UnregisterNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -269,18 +269,15 @@ func (o *UnregisterNodeDefaultBody) contextValidateDetails(ctx context.Context, } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { + if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("UnregisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { + } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("UnregisterNode default" + "." + "details" + "." + strconv.Itoa(i)) } - return err } } + } return nil @@ -309,17 +306,19 @@ UnregisterNodeDefaultBodyDetailsItems0 unregister node default body details item swagger:model UnregisterNodeDefaultBodyDetailsItems0 */ type UnregisterNodeDefaultBodyDetailsItems0 struct { + // at type AtType string `json:"@type,omitempty"` // unregister node default body details items0 - UnregisterNodeDefaultBodyDetailsItems0 map[string]any `json:"-"` + UnregisterNodeDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *UnregisterNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -340,9 +339,9 @@ func (o *UnregisterNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) erro delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]any) + result := make(map[string]interface{}) for k, v := range stage2 { - var toadd any + var toadd interface{} if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -357,6 +356,7 @@ func (o *UnregisterNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) erro // MarshalJSON marshals this object with additional properties into a JSON object func (o UnregisterNodeDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { + // at type AtType string `json:"@type,omitempty"` } @@ -420,6 +420,7 @@ UnregisterNodeOKBody unregister node OK body swagger:model UnregisterNodeOKBody */ type UnregisterNodeOKBody struct { + // Warning message if there are more service tokens attached to service account. Warning string `json:"warning,omitempty"` } diff --git a/api/management/v1/json/v1.json b/api/management/v1/json/v1.json index 77060c656b4..8b89ddb89c4 100644 --- a/api/management/v1/json/v1.json +++ b/api/management/v1/json/v1.json @@ -74,37 +74,6 @@ "type": "boolean", "x-order": 4 }, - "azure_options": { - "type": "object", - "properties": { - "client_id": { - "description": "Azure client ID.", - "type": "string", - "x-order": 0 - }, - "is_client_secret_set": { - "description": "True if Azure client secret is set.", - "type": "boolean", - "x-order": 1 - }, - "resource_group": { - "description": "Azure resource group.", - "type": "string", - "x-order": 2 - }, - "subscription_id": { - "description": "Azure subscription ID.", - "type": "string", - "x-order": 3 - }, - "tenant_id": { - "description": "Azure tenant ID.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 5 - }, "created_at": { "description": "Creation timestamp.", "type": "string", @@ -138,21 +107,6 @@ "format": "int64", "x-order": 10 }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "x-order": 11 - }, "max_query_length": { "description": "Limit query length in QAN.", "type": "integer", @@ -175,70 +129,6 @@ "type": "string", "x-order": 15 }, - "mongo_db_options": { - "type": "object", - "properties": { - "is_tls_certificate_key_set": { - "description": "True if TLS certificate is set.", - "type": "boolean", - "x-order": 0 - }, - "is_tls_certificate_key_file_password_set": { - "description": "True if TLS certificate file password is set.", - "type": "boolean", - "x-order": 1 - }, - "authentication_mechanism": { - "description": "MongoDB auth mechanism.", - "type": "string", - "x-order": 2 - }, - "authentication_database": { - "description": "MongoDB auth database.", - "type": "string", - "x-order": 3 - }, - "stats_collections": { - "description": "MongoDB stats collections.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 4 - }, - "collections_limit": { - "description": "MongoDB collections limit.", - "type": "integer", - "format": "int32", - "x-order": 5 - }, - "enable_all_collectors": { - "description": "True if all collectors are enabled.", - "type": "boolean", - "x-order": 6 - } - }, - "x-order": 16 - }, - "mysql_options": { - "type": "object", - "properties": { - "is_tls_key_set": { - "description": "True if TLS key is set.", - "type": "boolean", - "x-order": 0 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 17 - }, "node_id": { "description": "A unique node identifier.", "type": "string", @@ -254,29 +144,6 @@ "type": "string", "x-order": 20 }, - "postgresql_options": { - "type": "object", - "properties": { - "is_ssl_key_set": { - "description": "True if TLS key is set.", - "type": "boolean", - "x-order": 0 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "max_exporter_connections": { - "description": "Maximum number of connections from exporter to PostgreSQL instance.", - "type": "integer", - "format": "int32", - "x-order": 2 - } - }, - "x-order": 21 - }, "process_exec_path": { "description": "Path to exec process.", "type": "string", @@ -370,114 +237,239 @@ "type": "boolean", "x-order": 39 }, - "valkey_options": { - "type": "object", - "x-order": 40 - }, - "rta_options": { - "description": "RTAOptions holds Real-Time Query Analytics agent options.", + "azure_options": { "type": "object", "properties": { - "collect_interval": { - "description": "Query collect interval (default 2s is set by server).", + "client_id": { + "description": "Azure client ID.", "type": "string", "x-order": 0 + }, + "is_client_secret_set": { + "description": "True if Azure client secret is set.", + "type": "boolean", + "x-order": 1 + }, + "resource_group": { + "description": "Azure resource group.", + "type": "string", + "x-order": 2 + }, + "subscription_id": { + "description": "Azure subscription ID.", + "type": "string", + "x-order": 3 + }, + "tenant_id": { + "description": "Azure tenant ID.", + "type": "string", + "x-order": 4 } - }, - "x-order": 41 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/agents/versions": { - "get": { - "description": "Lists Agent versions and their update severity.", - "tags": [ - "ManagementService" - ], - "summary": "List Agent Versions", - "operationId": "ListAgentVersions", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "agent_versions": { - "description": "List of Agent versions.", - "type": "array", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Agent ID.", - "type": "string", - "x-order": 0 - }, - "version": { - "description": "Agent version.", - "type": "string", - "x-order": 1 - }, - "node_name": { - "description": "Node name where the agent runs.", - "type": "string", - "x-order": 2 + } }, - "severity": { - "description": " - UPDATE_SEVERITY_UNSUPPORTED: The client version is newer than the server version.\n - UPDATE_SEVERITY_UP_TO_DATE: The client version matches the server version.\n - UPDATE_SEVERITY_REQUIRED: The client's minor or patch version is older.\n - UPDATE_SEVERITY_CRITICAL: The client's major version is older.", + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", "type": "string", - "default": "UPDATE_SEVERITY_UNSPECIFIED", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", "enum": [ - "UPDATE_SEVERITY_UNSPECIFIED", - "UPDATE_SEVERITY_UNSUPPORTED", - "UPDATE_SEVERITY_UP_TO_DATE", - "UPDATE_SEVERITY_REQUIRED", - "UPDATE_SEVERITY_CRITICAL" - ], - "x-order": 3 - } - } - }, - "x-order": 0 + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] + }, + "mongo_db_options": { + "type": "object", + "properties": { + "is_tls_certificate_key_set": { + "description": "True if TLS certificate is set.", + "type": "boolean", + "x-order": 0 + }, + "is_tls_certificate_key_file_password_set": { + "description": "True if TLS certificate file password is set.", + "type": "boolean", + "x-order": 1 + }, + "authentication_mechanism": { + "description": "MongoDB auth mechanism.", + "type": "string", + "x-order": 2 + }, + "authentication_database": { + "description": "MongoDB auth database.", + "type": "string", + "x-order": 3 + }, + "stats_collections": { + "description": "MongoDB stats collections.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 4 + }, + "collections_limit": { + "description": "MongoDB collections limit.", + "type": "integer", + "format": "int32", + "x-order": 5 + }, + "enable_all_collectors": { + "description": "True if all collectors are enabled.", + "type": "boolean", + "x-order": 6 + } + } + }, + "mysql_options": { + "type": "object", + "properties": { + "is_tls_key_set": { + "description": "True if TLS key is set.", + "type": "boolean", + "x-order": 0 + }, + "extra_dsn_params": { + "description": "Extra DSN parameters for MySQL connection.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 1 + } + } + }, + "postgresql_options": { + "type": "object", + "properties": { + "is_ssl_key_set": { + "description": "True if TLS key is set.", + "type": "boolean", + "x-order": 0 + }, + "auto_discovery_limit": { + "description": "Limit of databases for auto-discovery.", + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "max_exporter_connections": { + "description": "Maximum number of connections from exporter to PostgreSQL instance.", + "type": "integer", + "format": "int32", + "x-order": 2 + } + } + }, + "rta_options": { + "description": "RTAOptions holds Real-Time Query Analytics agent options.", + "type": "object", + "properties": { + "collect_interval": { + "description": "Query collect interval (default 2s is set by server).", + "type": "string", + "x-order": 0 + } + } + }, + "valkey_options": { + "type": "object" + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": {} + }, + "x-order": 2 + } + } + } + } + } + } + }, + "/v1/management/agents/versions": { + "get": { + "description": "Lists Agent versions and their update severity.", + "tags": [ + "ManagementService" + ], + "summary": "List Agent Versions", + "operationId": "ListAgentVersions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "agent_versions": { + "description": "List of Agent versions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "agent_id": { + "description": "Agent ID.", + "type": "string", + "x-order": 0 + }, + "version": { + "description": "Agent version.", + "type": "string", + "x-order": 1 + }, + "node_name": { + "description": "Node name where the agent runs.", + "type": "string", + "x-order": 2 + }, + "severity": { + "description": " - UPDATE_SEVERITY_UNSUPPORTED: The client version is newer than the server version.\n - UPDATE_SEVERITY_UP_TO_DATE: The client version matches the server version.\n - UPDATE_SEVERITY_REQUIRED: The client's minor or patch version is older.\n - UPDATE_SEVERITY_CRITICAL: The client's major version is older.", + "type": "string", + "default": "UPDATE_SEVERITY_UNSPECIFIED", + "enum": [ + "UPDATE_SEVERITY_UNSPECIFIED", + "UPDATE_SEVERITY_UNSUPPORTED", + "UPDATE_SEVERITY_UP_TO_DATE", + "UPDATE_SEVERITY_REQUIRED", + "UPDATE_SEVERITY_CRITICAL" + ] + } + } + }, + "x-order": 0 } } } @@ -716,18 +708,6 @@ "format": "date-time", "x-order": 13 }, - "status": { - "description": "Node status.\n\n - STATUS_UNSPECIFIED: Invalid status.\n - STATUS_UP: The node is up.\n - STATUS_DOWN: The node is down.\n - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet).", - "type": "string", - "default": "STATUS_UNSPECIFIED", - "enum": [ - "STATUS_UNSPECIFIED", - "STATUS_UP", - "STATUS_DOWN", - "STATUS_UNKNOWN" - ], - "x-order": 14 - }, "agents": { "description": "List of agents related to this node.", "type": "array", @@ -793,6 +773,17 @@ "description": "True if this node is a PMM Server node (HA mode).", "type": "boolean", "x-order": 18 + }, + "status": { + "description": "Node status.\n\n - STATUS_UNSPECIFIED: Invalid status.\n - STATUS_UP: The node is up.\n - STATUS_DOWN: The node is down.\n - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet).", + "type": "string", + "default": "STATUS_UNSPECIFIED", + "enum": [ + "STATUS_UNSPECIFIED", + "STATUS_UP", + "STATUS_DOWN", + "STATUS_UNKNOWN" + ] } } }, @@ -849,20 +840,6 @@ "schema": { "type": "object", "properties": { - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 - }, "node_name": { "description": "A user-defined name unique across all Nodes.", "type": "string", @@ -921,17 +898,6 @@ "type": "boolean", "x-order": 11 }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ], - "x-order": 12 - }, "disable_collectors": { "description": "List of collector names to disable in this exporter.", "type": "array", @@ -954,24 +920,57 @@ "description": "AWS instance ID.", "type": "string", "x-order": 16 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "generic_node": { - "description": "GenericNode represents a bare metal server or virtual machine.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ] + }, + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ] + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "token": { + "description": "Token represents token for vmagent auth config.", + "type": "string", + "x-order": 3 + }, + "warning": { + "description": "Warning message.", + "type": "string", + "x-order": 4 + }, + "container_node": { + "description": "ContainerNode represents a Docker container.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", "x-order": 0 }, "node_name": { @@ -985,29 +984,34 @@ "x-order": 2 }, "machine_id": { - "description": "Linux machine-id.", + "description": "Linux machine-id of the Generic Node where this Container Node runs.", "type": "string", "x-order": 3 }, - "distro": { - "description": "Linux distribution name and version.", + "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": 5 + "x-order": 6 }, "region": { "description": "Node region.", "type": "string", - "x-order": 6 + "x-order": 7 }, "az": { "description": "Node availability zone.", "type": "string", - "x-order": 7 + "x-order": 8 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -1015,18 +1019,17 @@ "additionalProperties": { "type": "string" }, - "x-order": 8 + "x-order": 9 }, "is_pmm_server_node": { "description": "True if this node is a PMM Server node (HA mode).", "type": "boolean", - "x-order": 9 + "x-order": 10 } - }, - "x-order": 0 + } }, - "container_node": { - "description": "ContainerNode represents a Docker container.", + "generic_node": { + "description": "GenericNode represents a bare metal server or virtual machine.", "type": "object", "properties": { "node_id": { @@ -1045,34 +1048,29 @@ "x-order": 2 }, "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "description": "Linux machine-id.", "type": "string", "x-order": 3 }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "distro": { + "description": "Linux distribution name and version.", "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 + "x-order": 5 }, "region": { "description": "Node region.", "type": "string", - "x-order": 7 + "x-order": 6 }, "az": { "description": "Node availability zone.", "type": "string", - "x-order": 8 + "x-order": 7 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -1080,15 +1078,14 @@ "additionalProperties": { "type": "string" }, - "x-order": 9 + "x-order": 8 }, "is_pmm_server_node": { "description": "True if this node is a PMM Server node (HA mode).", "type": "boolean", - "x-order": 10 + "x-order": 9 } - }, - "x-order": 1 + } }, "pmm_agent": { "description": "PMMAgent runs on Generic or Container Node.", @@ -1122,18 +1119,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 2 - }, - "token": { - "description": "Token represents token for vmagent auth config.", - "type": "string", - "x-order": 3 - }, - "warning": { - "description": "Warning message.", - "type": "string", - "x-order": 4 + } } } } @@ -1273,18 +1259,6 @@ "format": "date-time", "x-order": 13 }, - "status": { - "description": "Node status.\n\n - STATUS_UNSPECIFIED: Invalid status.\n - STATUS_UP: The node is up.\n - STATUS_DOWN: The node is down.\n - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet).", - "type": "string", - "default": "STATUS_UNSPECIFIED", - "enum": [ - "STATUS_UNSPECIFIED", - "STATUS_UP", - "STATUS_DOWN", - "STATUS_UNKNOWN" - ], - "x-order": 14 - }, "agents": { "description": "List of agents related to this node.", "type": "array", @@ -1350,9 +1324,19 @@ "description": "True if this node is a PMM Server node (HA mode).", "type": "boolean", "x-order": 18 + }, + "status": { + "description": "Node status.\n\n - STATUS_UNSPECIFIED: Invalid status.\n - STATUS_UP: The node is up.\n - STATUS_DOWN: The node is down.\n - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet).", + "type": "string", + "default": "STATUS_UNSPECIFIED", + "enum": [ + "STATUS_UNSPECIFIED", + "STATUS_UP", + "STATUS_DOWN", + "STATUS_UNKNOWN" + ] } - }, - "x-order": 0 + } } } } @@ -1460,6 +1444,100 @@ } } }, + "/v1/management/nodes:installToken": { + "post": { + "description": "Creates a short-lived Grafana service account token for PMM Client install.", + "tags": [ + "ManagementService" + ], + "summary": "Create Node Install Token", + "operationId": "CreateNodeInstallToken", + "parameters": [ + { + "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", + "type": "object", + "properties": { + "ttl_seconds": { + "description": "Token TTL in seconds; 0 means use server default. Server clamps to a maximum.", + "type": "integer", + "format": "int64", + "x-order": 0 + }, + "technology": { + "description": "Technology for install script TECH env (e.g. mysql, postgresql, mongodb).", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "description": "CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL.", + "type": "object", + "properties": { + "token": { + "description": "Plaintext token for PMM_SERVER_URL userinfo (service_token:\u003ctoken\u003e).", + "type": "string", + "x-order": 0 + }, + "expires_at": { + "description": "Expiration time of the token (derived from TTL).", + "type": "string", + "format": "date-time", + "x-order": 1 + }, + "service_account_id": { + "description": "Grafana service account id created for this install token flow.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + } + }, + "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": {} + }, + "x-order": 2 + } + } + } + } + } + } + }, "/v1/management/services": { "get": { "description": "Returns a filtered list of Services.", @@ -1628,37 +1706,6 @@ "type": "boolean", "x-order": 4 }, - "azure_options": { - "type": "object", - "properties": { - "client_id": { - "description": "Azure client ID.", - "type": "string", - "x-order": 0 - }, - "is_client_secret_set": { - "description": "True if Azure client secret is set.", - "type": "boolean", - "x-order": 1 - }, - "resource_group": { - "description": "Azure resource group.", - "type": "string", - "x-order": 2 - }, - "subscription_id": { - "description": "Azure subscription ID.", - "type": "string", - "x-order": 3 - }, - "tenant_id": { - "description": "Azure tenant ID.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 5 - }, "created_at": { "description": "Creation timestamp.", "type": "string", @@ -1692,21 +1739,6 @@ "format": "int64", "x-order": 10 }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "x-order": 11 - }, "max_query_length": { "description": "Limit query length in QAN.", "type": "integer", @@ -1729,70 +1761,6 @@ "type": "string", "x-order": 15 }, - "mongo_db_options": { - "type": "object", - "properties": { - "is_tls_certificate_key_set": { - "description": "True if TLS certificate is set.", - "type": "boolean", - "x-order": 0 - }, - "is_tls_certificate_key_file_password_set": { - "description": "True if TLS certificate file password is set.", - "type": "boolean", - "x-order": 1 - }, - "authentication_mechanism": { - "description": "MongoDB auth mechanism.", - "type": "string", - "x-order": 2 - }, - "authentication_database": { - "description": "MongoDB auth database.", - "type": "string", - "x-order": 3 - }, - "stats_collections": { - "description": "MongoDB stats collections.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 4 - }, - "collections_limit": { - "description": "MongoDB collections limit.", - "type": "integer", - "format": "int32", - "x-order": 5 - }, - "enable_all_collectors": { - "description": "True if all collectors are enabled.", - "type": "boolean", - "x-order": 6 - } - }, - "x-order": 16 - }, - "mysql_options": { - "type": "object", - "properties": { - "is_tls_key_set": { - "description": "True if TLS key is set.", - "type": "boolean", - "x-order": 0 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 17 - }, "node_id": { "description": "A unique node identifier.", "type": "string", @@ -1808,29 +1776,6 @@ "type": "string", "x-order": 20 }, - "postgresql_options": { - "type": "object", - "properties": { - "is_ssl_key_set": { - "description": "True if TLS key is set.", - "type": "boolean", - "x-order": 0 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "max_exporter_connections": { - "description": "Maximum number of connections from exporter to PostgreSQL instance.", - "type": "integer", - "format": "int32", - "x-order": 2 - } - }, - "x-order": 21 - }, "process_exec_path": { "description": "Path to exec process.", "type": "string", @@ -1924,9 +1869,133 @@ "type": "boolean", "x-order": 39 }, - "valkey_options": { + "azure_options": { + "type": "object", + "properties": { + "client_id": { + "description": "Azure client ID.", + "type": "string", + "x-order": 0 + }, + "is_client_secret_set": { + "description": "True if Azure client secret is set.", + "type": "boolean", + "x-order": 1 + }, + "resource_group": { + "description": "Azure resource group.", + "type": "string", + "x-order": 2 + }, + "subscription_id": { + "description": "Azure subscription ID.", + "type": "string", + "x-order": 3 + }, + "tenant_id": { + "description": "Azure tenant ID.", + "type": "string", + "x-order": 4 + } + } + }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] + }, + "mongo_db_options": { + "type": "object", + "properties": { + "is_tls_certificate_key_set": { + "description": "True if TLS certificate is set.", + "type": "boolean", + "x-order": 0 + }, + "is_tls_certificate_key_file_password_set": { + "description": "True if TLS certificate file password is set.", + "type": "boolean", + "x-order": 1 + }, + "authentication_mechanism": { + "description": "MongoDB auth mechanism.", + "type": "string", + "x-order": 2 + }, + "authentication_database": { + "description": "MongoDB auth database.", + "type": "string", + "x-order": 3 + }, + "stats_collections": { + "description": "MongoDB stats collections.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 4 + }, + "collections_limit": { + "description": "MongoDB collections limit.", + "type": "integer", + "format": "int32", + "x-order": 5 + }, + "enable_all_collectors": { + "description": "True if all collectors are enabled.", + "type": "boolean", + "x-order": 6 + } + } + }, + "mysql_options": { + "type": "object", + "properties": { + "is_tls_key_set": { + "description": "True if TLS key is set.", + "type": "boolean", + "x-order": 0 + }, + "extra_dsn_params": { + "description": "Extra DSN parameters for MySQL connection.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 1 + } + } + }, + "postgresql_options": { "type": "object", - "x-order": 40 + "properties": { + "is_ssl_key_set": { + "description": "True if TLS key is set.", + "type": "boolean", + "x-order": 0 + }, + "auto_discovery_limit": { + "description": "Limit of databases for auto-discovery.", + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "max_exporter_connections": { + "description": "Maximum number of connections from exporter to PostgreSQL instance.", + "type": "integer", + "format": "int32", + "x-order": 2 + } + } }, "rta_options": { "description": "RTAOptions holds Real-Time Query Analytics agent options.", @@ -1937,13 +2006,20 @@ "type": "string", "x-order": 0 } - }, - "x-order": 41 + } + }, + "valkey_options": { + "type": "object" } } }, "x-order": 16 }, + "version": { + "description": "The service/database version.", + "type": "string", + "x-order": 18 + }, "status": { "description": "Service status.\n\n - STATUS_UNSPECIFIED: In case we don't support the db vendor yet.\n - STATUS_UP: The service is up.\n - STATUS_DOWN: The service is down.\n - STATUS_UNKNOWN: The service's status cannot be known (e.g. there are no metrics yet).", "type": "string", @@ -1953,13 +2029,7 @@ "STATUS_UP", "STATUS_DOWN", "STATUS_UNKNOWN" - ], - "x-order": 17 - }, - "version": { - "description": "The service/database version.", - "type": "string", - "x-order": 18 + ] } } }, @@ -2016,301 +2086,102 @@ "schema": { "type": "object", "properties": { - "mysql": { + "external": { "type": "object", "properties": { - "node_id": { - "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "runs_on_node_id": { + "description": "Node identifier on which an external exporter is been running.\nruns_on_node_id should always be passed with node_id.\nExactly one of these parameters should be present: node_id, node_name, add_node.", "type": "string", "x-order": 0 }, "node_name": { - "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", "type": "string", "x-order": 1 }, - "add_node": { - "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", - "type": "object", - "properties": { - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "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 - }, - "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 for Node.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 2 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Required.", + "address": { + "description": "Node and Exporter access address (DNS name or IP).\naddress should always be passed with add_node.", "type": "string", "x-order": 3 }, - "address": { - "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", + "service_name": { + "description": "Unique across all Services user-defined name. Required.", "type": "string", "x-order": 4 }, - "port": { - "description": "Service Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", + "username": { + "description": "HTTP basic auth username for collecting metrics.", + "type": "string", "x-order": 5 }, - "socket": { - "description": "Service Access socket.\nAddress (and port) or socket is required.", + "password": { + "description": "HTTP basic auth password for collecting metrics.", "type": "string", "x-order": 6 }, - "pmm_agent_id": { - "description": "The \"pmm-agent\" identifier which should run agents. Required.", + "scheme": { + "description": "Scheme to generate URI to exporter metrics endpoints.", "type": "string", "x-order": 7 }, - "environment": { - "description": "Environment name.", + "metrics_path": { + "description": "Path under which metrics are exposed, used to generate URI.", "type": "string", "x-order": 8 }, - "cluster": { - "description": "Cluster name.", - "type": "string", + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", "x-order": 9 }, - "replication_set": { - "description": "Replication set name.", + "node_id": { + "description": "Node identifier on which an external service is been running.\nnode_id should always be passed with runs_on_node_id.", "type": "string", "x-order": 10 }, - "username": { - "description": "MySQL username for scraping metrics.", + "environment": { + "description": "Environment name.", "type": "string", "x-order": 11 }, - "password": { - "description": "MySQL password for scraping metrics.", + "cluster": { + "description": "Cluster name.", "type": "string", "x-order": 12 }, - "qan_mysql_perfschema": { - "description": "If true, adds qan-mysql-perfschema-agent for provided service.", - "type": "boolean", + "replication_set": { + "description": "Replication set name.", + "type": "string", "x-order": 13 }, - "qan_mysql_slowlog": { - "description": "If true, adds qan-mysql-slowlog-agent for provided service.", - "type": "boolean", - "x-order": 14 - }, "custom_labels": { "description": "Custom user-assigned labels for Service.", "type": "object", "additionalProperties": { "type": "string" }, + "x-order": 14 + }, + "group": { + "description": "Group name of external service.", + "type": "string", "x-order": 15 }, "skip_connection_check": { "description": "Skip connection check.", "type": "boolean", - "x-order": 16 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", "x-order": 17 }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 18 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 19 - }, - "max_slowlog_file_size": { - "description": "If qan-mysql-slowlog-agent is added, slowlog file is rotated at this size if \u003e 0.\nIf zero, server's default value is used.\nUse negative value to disable rotation.", - "type": "string", - "format": "int64", - "x-order": 20 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 21 - }, "tls_skip_verify": { "description": "Skip TLS certificate and hostname validation.", "type": "boolean", - "x-order": 22 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 23 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 24 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 25 - }, - "tablestats_group_table_limit": { - "description": "Tablestats group collectors will be disabled if there are more than that number of tables.\nIf zero, server's default value is used.\nUse negative value to disable them.", - "type": "integer", - "format": "int32", - "x-order": 26 - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ], - "x-order": 27 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 28 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 29 - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "x-order": 30 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 31 - }, - "extra_dsn_params": { - "description": "extra DSN parameters to be used for connecting to MySQL.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 32 - } - }, - "x-order": 0 - }, - "mongodb": { - "type": "object", - "properties": { - "node_id": { - "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 1 + "x-order": 18 }, "add_node": { "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 - }, "node_name": { "description": "Unique across all Nodes user-defined name.", "type": "string", @@ -2358,21 +2229,219 @@ "type": "string" }, "x-order": 9 + }, + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ] } - }, - "x-order": 2 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 3 + } }, - "address": { - "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", "type": "string", - "x-order": 4 - }, - "port": { + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ] + } + } + }, + "haproxy": { + "type": "object", + "properties": { + "node_id": { + "description": "Node identifier on which an external exporter is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node and Exporter access address (DNS name or IP).\naddress always should be passed with add_node.", + "type": "string", + "x-order": 3 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 4 + }, + "username": { + "description": "HTTP basic auth username for collecting metrics.", + "type": "string", + "x-order": 5 + }, + "password": { + "description": "HTTP basic auth password for collecting metrics.", + "type": "string", + "x-order": 6 + }, + "scheme": { + "description": "Scheme to generate URI to exporter metrics endpoints.", + "type": "string", + "x-order": 7 + }, + "metrics_path": { + "description": "Path under which metrics are exposed, used to generate URI.", + "type": "string", + "x-order": 8 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 9 + }, + "environment": { + "description": "Environment name.", + "type": "string", + "x-order": 10 + }, + "cluster": { + "description": "Cluster name.", + "type": "string", + "x-order": 11 + }, + "replication_set": { + "description": "Replication set name.", + "type": "string", + "x-order": 12 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Service.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 13 + }, + "skip_connection_check": { + "description": "Skip connection check.", + "type": "boolean", + "x-order": 15 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 16 + }, + "add_node": { + "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "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 + }, + "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 for Node.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + }, + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ] + } + } + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ] + } + } + }, + "mongodb": { + "type": "object", + "properties": { + "node_id": { + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 3 + }, + "address": { + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 4 + }, + "port": { "description": "Service Access port.\nPort is required when the address present.", "type": "integer", "format": "int64", @@ -2467,17 +2536,6 @@ "format": "int32", "x-order": 22 }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ], - "x-order": 23 - }, "disable_collectors": { "description": "List of collector names to disable in this exporter.", "type": "array", @@ -2520,21 +2578,6 @@ "title": "Enable all collectors", "x-order": 30 }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "x-order": 31 - }, "expose_exporter": { "type": "boolean", "title": "Optionally expose the exporter process on all public interfaces", @@ -2552,41 +2595,11 @@ "description": "If true, adds Real-Time Analytics agent for the provided service.", "type": "boolean", "x-order": 34 - } - }, - "x-order": 1 - }, - "postgresql": { - "type": "object", - "properties": { - "node_id": { - "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 1 }, "add_node": { "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 - }, "node_name": { "description": "Unique across all Nodes user-defined name.", "type": "string", @@ -2634,9 +2647,60 @@ "type": "string" }, "x-order": 9 + }, + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ] } - }, - "x-order": 2 + } + }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ] + } + } + }, + "mysql": { + "type": "object", + "properties": { + "node_id": { + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 }, "service_name": { "description": "Unique across all Services user-defined name. Required.", @@ -2654,66 +2718,50 @@ "format": "int64", "x-order": 5 }, - "database": { - "description": "Database name.", - "type": "string", - "x-order": 6 - }, "socket": { "description": "Service Access socket.\nAddress (and port) or socket is required.", "type": "string", - "x-order": 7 + "x-order": 6 }, "pmm_agent_id": { "description": "The \"pmm-agent\" identifier which should run agents. Required.", "type": "string", - "x-order": 8 + "x-order": 7 }, "environment": { "description": "Environment name.", "type": "string", - "x-order": 9 + "x-order": 8 }, "cluster": { "description": "Cluster name.", "type": "string", - "x-order": 10 + "x-order": 9 }, "replication_set": { "description": "Replication set name.", "type": "string", - "x-order": 11 + "x-order": 10 }, "username": { - "description": "PostgreSQL username for scraping metrics.", + "description": "MySQL username for scraping metrics.", "type": "string", - "x-order": 12 + "x-order": 11 }, "password": { - "description": "PostgreSQL password for scraping metrics.", + "description": "MySQL password for scraping metrics.", "type": "string", - "x-order": 13 - }, - "qan_postgresql_pgstatements_agent": { - "description": "If true, adds qan-postgresql-pgstatements-agent for provided service.", - "type": "boolean", - "x-order": 14 + "x-order": 12 }, - "qan_postgresql_pgstatmonitor_agent": { - "description": "If true, adds qan-postgresql-pgstatmonitor-agent for provided service.", + "qan_mysql_perfschema": { + "description": "If true, adds qan-mysql-perfschema-agent for provided service.", "type": "boolean", - "x-order": 15 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 16 + "x-order": 13 }, - "disable_query_examples": { - "description": "Disable query examples.", + "qan_mysql_slowlog": { + "description": "If true, adds qan-mysql-slowlog-agent for provided service.", "type": "boolean", - "x-order": 17 + "x-order": 14 }, "custom_labels": { "description": "Custom user-assigned labels for Service.", @@ -2721,16 +2769,33 @@ "additionalProperties": { "type": "string" }, - "x-order": 18 + "x-order": 15 }, "skip_connection_check": { "description": "Skip connection check.", "type": "boolean", - "x-order": 19 + "x-order": 16 }, "disable_comments_parsing": { "description": "Disable parsing comments from queries and showing them in QAN.", "type": "boolean", + "x-order": 17 + }, + "max_query_length": { + "description": "Limit query length in QAN (default: server-defined; -1: no limit).", + "type": "integer", + "format": "int32", + "x-order": 18 + }, + "disable_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "x-order": 19 + }, + "max_slowlog_file_size": { + "description": "If qan-mysql-slowlog-agent is added, slowlog file is rotated at this size if \u003e 0.\nIf zero, server's default value is used.\nUse negative value to disable rotation.", + "type": "string", + "format": "int64", "x-order": 20 }, "tls": { @@ -2739,115 +2804,61 @@ "x-order": 21 }, "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", + "description": "Skip TLS certificate and hostname validation.", "type": "boolean", "x-order": 22 }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "tls_ca": { + "description": "Certificate Authority certificate chain.", "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ], "x-order": 23 }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, + "tls_cert": { + "description": "Client certificate.", + "type": "string", "x-order": 24 }, - "tls_ca": { - "description": "TLS CA certificate.", + "tls_key": { + "description": "Password for decrypting tls_cert.", "type": "string", "x-order": 25 }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", + "tablestats_group_table_limit": { + "description": "Tablestats group collectors will be disabled if there are more than that number of tables.\nIf zero, server's default value is used.\nUse negative value to disable them.", + "type": "integer", + "format": "int32", "x-order": 26 }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 27 + "disable_collectors": { + "description": "List of collector names to disable in this exporter.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 28 }, "agent_password": { "description": "Custom password for exporter endpoint /metrics.", "type": "string", - "x-order": 28 - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], "x-order": 29 }, - "auto_discovery_limit": { - "description": "Limit for auto discovery.", - "type": "integer", - "format": "int32", - "x-order": 30 - }, "expose_exporter": { "type": "boolean", "title": "Optionally expose the exporter process on all public interfaces", "x-order": 31 }, - "max_exporter_connections": { - "description": "Maximum number of connections that exporter can open to the database instance.", - "type": "integer", - "format": "int32", + "extra_dsn_params": { + "description": "extra DSN parameters to be used for connecting to MySQL.", + "type": "object", + "additionalProperties": { + "type": "string" + }, "x-order": 32 - } - }, - "x-order": 2 - }, - "proxysql": { - "type": "object", - "properties": { - "node_id": { - "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 1 }, "add_node": { "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 - }, "node_name": { "description": "Unique across all Nodes user-defined name.", "type": "string", @@ -2895,9 +2906,60 @@ "type": "string" }, "x-order": 9 + }, + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ] } - }, - "x-order": 2 + } + }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ] + } + } + }, + "postgresql": { + "type": "object", + "properties": { + "node_id": { + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 }, "service_name": { "description": "Unique across all Services user-defined name. Required.", @@ -2915,40 +2977,66 @@ "format": "int64", "x-order": 5 }, + "database": { + "description": "Database name.", + "type": "string", + "x-order": 6 + }, "socket": { "description": "Service Access socket.\nAddress (and port) or socket is required.", "type": "string", - "x-order": 6 + "x-order": 7 }, "pmm_agent_id": { "description": "The \"pmm-agent\" identifier which should run agents. Required.", "type": "string", - "x-order": 7 + "x-order": 8 }, "environment": { "description": "Environment name.", "type": "string", - "x-order": 8 + "x-order": 9 }, "cluster": { "description": "Cluster name.", "type": "string", - "x-order": 9 + "x-order": 10 }, "replication_set": { "description": "Replication set name.", "type": "string", - "x-order": 10 + "x-order": 11 }, "username": { - "description": "ProxySQL username for scraping metrics.", + "description": "PostgreSQL username for scraping metrics.", "type": "string", - "x-order": 11 + "x-order": 12 }, "password": { - "description": "ProxySQL password for scraping metrics.", + "description": "PostgreSQL password for scraping metrics.", "type": "string", - "x-order": 12 + "x-order": 13 + }, + "qan_postgresql_pgstatements_agent": { + "description": "If true, adds qan-postgresql-pgstatements-agent for provided service.", + "type": "boolean", + "x-order": 14 + }, + "qan_postgresql_pgstatmonitor_agent": { + "description": "If true, adds qan-postgresql-pgstatmonitor-agent for provided service.", + "type": "boolean", + "x-order": 15 + }, + "max_query_length": { + "description": "Limit query length in QAN (default: server-defined; -1: no limit).", + "type": "integer", + "format": "int32", + "x-order": 16 + }, + "disable_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "x-order": 17 }, "custom_labels": { "description": "Custom user-assigned labels for Service.", @@ -2956,33 +3044,27 @@ "additionalProperties": { "type": "string" }, - "x-order": 13 + "x-order": 18 }, "skip_connection_check": { "description": "Skip connection check.", "type": "boolean", - "x-order": 14 + "x-order": 19 + }, + "disable_comments_parsing": { + "description": "Disable parsing comments from queries and showing them in QAN.", + "type": "boolean", + "x-order": 20 }, "tls": { "description": "Use TLS for database connections.", "type": "boolean", - "x-order": 15 + "x-order": 21 }, "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", + "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", "type": "boolean", - "x-order": 16 - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ], - "x-order": 17 + "x-order": 22 }, "disable_collectors": { "description": "List of collector names to disable in this exporter.", @@ -2990,67 +3072,49 @@ "items": { "type": "string" }, - "x-order": 18 + "x-order": 24 + }, + "tls_ca": { + "description": "TLS CA certificate.", + "type": "string", + "x-order": 25 + }, + "tls_cert": { + "description": "TLS Certifcate.", + "type": "string", + "x-order": 26 + }, + "tls_key": { + "description": "TLS Certificate Key.", + "type": "string", + "x-order": 27 }, "agent_password": { "description": "Custom password for exporter endpoint /metrics.", "type": "string", - "x-order": 19 + "x-order": 28 }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "x-order": 20 + "auto_discovery_limit": { + "description": "Limit for auto discovery.", + "type": "integer", + "format": "int32", + "x-order": 30 }, "expose_exporter": { "type": "boolean", "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 21 - } - }, - "x-order": 3 - }, - "haproxy": { - "type": "object", - "properties": { - "node_id": { - "description": "Node identifier on which an external exporter is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 0 + "x-order": 31 }, - "node_name": { - "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 1 + "max_exporter_connections": { + "description": "Maximum number of connections that exporter can open to the database instance.", + "type": "integer", + "format": "int32", + "x-order": 32 }, "add_node": { "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 - }, "node_name": { "description": "Unique across all Nodes user-defined name.", "type": "string", @@ -3098,58 +3162,109 @@ "type": "string" }, "x-order": 9 + }, + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ] } - }, - "x-order": 2 + } }, - "address": { - "description": "Node and Exporter access address (DNS name or IP).\naddress always should be passed with add_node.", + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", "type": "string", - "x-order": 3 + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ] + } + } + }, + "proxysql": { + "type": "object", + "properties": { + "node_id": { + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 }, "service_name": { "description": "Unique across all Services user-defined name. Required.", "type": "string", - "x-order": 4 + "x-order": 3 }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", + "address": { + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", "type": "string", + "x-order": 4 + }, + "port": { + "description": "Service Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", "x-order": 5 }, - "password": { - "description": "HTTP basic auth password for collecting metrics.", + "socket": { + "description": "Service Access socket.\nAddress (and port) or socket is required.", "type": "string", "x-order": 6 }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", + "pmm_agent_id": { + "description": "The \"pmm-agent\" identifier which should run agents. Required.", "type": "string", "x-order": 7 }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", + "environment": { + "description": "Environment name.", "type": "string", "x-order": 8 }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", + "cluster": { + "description": "Cluster name.", + "type": "string", "x-order": 9 }, - "environment": { - "description": "Environment name.", + "replication_set": { + "description": "Replication set name.", "type": "string", "x-order": 10 }, - "cluster": { - "description": "Cluster name.", + "username": { + "description": "ProxySQL username for scraping metrics.", "type": "string", "x-order": 11 }, - "replication_set": { - "description": "Replication set name.", + "password": { + "description": "ProxySQL password for scraping metrics.", "type": "string", "x-order": 12 }, @@ -3161,61 +3276,43 @@ }, "x-order": 13 }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ], - "x-order": 14 - }, "skip_connection_check": { "description": "Skip connection check.", "type": "boolean", + "x-order": 14 + }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", "x-order": 15 }, "tls_skip_verify": { "description": "Skip TLS certificate and hostname validation.", "type": "boolean", "x-order": 16 - } - }, - "x-order": 4 - }, - "external": { - "type": "object", - "properties": { - "runs_on_node_id": { - "description": "Node identifier on which an external exporter is been running.\nruns_on_node_id should always be passed with node_id.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 0 }, - "node_name": { - "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "disable_collectors": { + "description": "List of collector names to disable in this exporter.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 18 + }, + "agent_password": { + "description": "Custom password for exporter endpoint /metrics.", "type": "string", - "x-order": 1 + "x-order": 19 + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 21 }, "add_node": { "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 - }, "node_name": { "description": "Unique across all Nodes user-defined name.", "type": "string", @@ -3263,78 +3360,35 @@ "type": "string" }, "x-order": 9 + }, + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ] } - }, - "x-order": 2 - }, - "address": { - "description": "Node and Exporter access address (DNS name or IP).\naddress should always be passed with add_node.", - "type": "string", - "x-order": 3 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 4 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 5 - }, - "password": { - "description": "HTTP basic auth password for collecting metrics.", - "type": "string", - "x-order": 6 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 7 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 8 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 9 - }, - "node_id": { - "description": "Node identifier on which an external service is been running.\nnode_id should always be passed with runs_on_node_id.", - "type": "string", - "x-order": 10 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 11 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 12 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 13 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 + } }, - "group": { - "description": "Group name of external service.", + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", "type": "string", - "x-order": 15 + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] }, "metrics_mode": { "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", @@ -3344,21 +3398,9 @@ "METRICS_MODE_UNSPECIFIED", "METRICS_MODE_PULL", "METRICS_MODE_PUSH" - ], - "x-order": 16 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 17 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 18 + ] } - }, - "x-order": 5 + } }, "rds": { "type": "object", @@ -3394,17 +3436,6 @@ "format": "int64", "x-order": 5 }, - "engine": { - "description": "DiscoverRDSEngine describes supported RDS instance engines.", - "type": "string", - "default": "DISCOVER_RDS_ENGINE_UNSPECIFIED", - "enum": [ - "DISCOVER_RDS_ENGINE_UNSPECIFIED", - "DISCOVER_RDS_ENGINE_MYSQL", - "DISCOVER_RDS_ENGINE_POSTGRESQL" - ], - "x-order": 6 - }, "pmm_agent_id": { "description": "PMM Agent ID.", "type": "string", @@ -3509,17 +3540,6 @@ "type": "boolean", "x-order": 26 }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ], - "x-order": 27 - }, "qan_postgresql_pgstatements": { "type": "boolean", "title": "If true, add qan-pgstatements", @@ -3551,9 +3571,28 @@ "type": "integer", "format": "int32", "x-order": 33 + }, + "engine": { + "description": "DiscoverRDSEngine describes supported RDS instance engines.", + "type": "string", + "default": "DISCOVER_RDS_ENGINE_UNSPECIFIED", + "enum": [ + "DISCOVER_RDS_ENGINE_UNSPECIFIED", + "DISCOVER_RDS_ENGINE_MYSQL", + "DISCOVER_RDS_ENGINE_POSTGRESQL" + ] + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ] } - }, - "x-order": 6 + } }, "valkey": { "type": "object", @@ -3568,75 +3607,6 @@ "type": "string", "x-order": 1 }, - "add_node": { - "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", - "type": "object", - "properties": { - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "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 - }, - "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 for Node.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 2 - }, "service_name": { "description": "User-defined name, it is required and should be unique across all services.", "type": "string", @@ -3711,32 +3681,6 @@ "type": "boolean", "x-order": 16 }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ], - "x-order": 17 - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "x-order": 18 - }, "expose_exporter": { "type": "boolean", "title": "Optionally expose the exporter process on all public interfaces", @@ -3761,99 +3705,115 @@ "description": "Custom password for exporter endpoint /metrics.", "type": "string", "x-order": 23 - } - }, - "x-order": 7 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "type": "object", - "properties": { - "service": { - "description": "MySQLService represents a generic MySQL instance.", + }, + "add_node": { + "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { - "service_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "service_name": { - "description": "Unique across all Services user-defined name.", + "node_name": { + "description": "Unique across all Nodes user-defined name.", "type": "string", "x-order": 1 }, - "node_id": { - "description": "Node identifier where this instance runs.", + "machine_id": { + "description": "Linux machine-id.", "type": "string", "x-order": 2 }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", + "distro": { + "description": "Linux distribution name and version.", "type": "string", "x-order": 3 }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", "x-order": 4 }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", + "container_name": { + "description": "Container name.", "type": "string", "x-order": 5 }, - "environment": { - "description": "Environment name.", + "node_model": { + "description": "Node model.", "type": "string", "x-order": 6 }, - "cluster": { - "description": "Cluster name.", + "region": { + "description": "Node region.", "type": "string", "x-order": 7 }, - "replication_set": { - "description": "Replication set name.", + "az": { + "description": "Node availability zone.", "type": "string", "x-order": 8 }, "custom_labels": { - "description": "Custom user-assigned labels.", + "description": "Custom user-assigned labels for Node.", "type": "object", "additionalProperties": { "type": "string" }, "x-order": 9 }, - "version": { - "description": "MySQL version.", + "node_type": { + "description": "NodeType describes supported Node types.", "type": "string", - "x-order": 10 - }, - "extra_dsn_params": { - "description": "Extra parameters to be added to the DSN.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ] } - }, - "x-order": 0 + } }, - "mysqld_exporter": { - "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ] + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "external": { + "type": "object", + "properties": { + "external_exporter": { + "description": "ExternalExporter runs on any Node type, including Remote Node.", "type": "object", "properties": { "agent_id": { @@ -3861,13 +3821,13 @@ "type": "string", "x-order": 0 }, - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", + "runs_on_node_id": { + "description": "Node identifier where this instance runs.", "type": "string", "x-order": 1 }, "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", + "description": "If disabled, metrics from this exporter will not be collected.", "type": "boolean", "x-order": 2 }, @@ -3877,40 +3837,19 @@ "x-order": 3 }, "username": { - "description": "MySQL username for scraping metrics.", + "description": "HTTP basic auth username for collecting metrics.", "type": "string", "x-order": 4 }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 5 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 6 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 7 - }, - "tls_cert": { - "description": "Client certificate.", + "scheme": { + "description": "Scheme to generate URI to exporter metrics endpoints.", "type": "string", - "x-order": 8 + "x-order": 5 }, - "tls_key": { - "description": "Password for decrypting tls_cert.", + "metrics_path": { + "description": "Path under which metrics are exposed, used to generate URI.", "type": "string", - "x-order": 9 - }, - "tablestats_group_table_limit": { - "description": "Tablestats group collectors are disabled if there are more than that number of tables.\n0 means tablestats group collectors are always enabled (no limit).\nNegative value means tablestats group collectors are always disabled.", - "type": "integer", - "format": "int32", - "x-order": 10 + "x-order": 6 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -3918,78 +3857,28 @@ "additionalProperties": { "type": "string" }, - "x-order": 11 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 12 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 13 - }, - "table_count": { - "description": "Actual table count at the moment of adding.", - "type": "integer", - "format": "int32", - "x-order": 14 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "x-order": 15 + "x-order": 7 }, "listen_port": { "description": "Listen port for scraping metrics.", "type": "integer", "format": "int64", - "x-order": 16 + "x-order": 8 }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", "type": "boolean", - "x-order": 17 + "x-order": 9 }, "process_exec_path": { "description": "Path to exec process.", "type": "string", - "x-order": 18 - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "x-order": 19 + "x-order": 10 }, - "expose_exporter": { + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname verification.", "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 20 + "x-order": 12 }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -4010,147 +3899,92 @@ "type": "string", "x-order": 2 } - }, - "x-order": 21 + } }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 22 + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ] } - }, - "x-order": 1 + } }, - "qan_mysql_perfschema": { - "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "service": { + "description": "ExternalService represents a generic External service instance.", "type": "object", "properties": { - "agent_id": { + "service_id": { "description": "Unique randomly generated instance identifier.", "type": "string", "x-order": 0 }, - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", + "service_name": { + "description": "Unique across all Services user-defined name.", "type": "string", "x-order": 1 }, - "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", - "type": "boolean", + "node_id": { + "description": "Node identifier where this service instance runs.", + "type": "string", "x-order": 2 }, - "service_id": { - "description": "Service identifier.", + "environment": { + "description": "Environment name.", "type": "string", "x-order": 3 }, - "username": { - "description": "MySQL username for getting performance data.", + "cluster": { + "description": "Cluster name.", "type": "string", "x-order": 4 }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 5 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 6 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 7 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 8 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 9 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 10 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 11 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 12 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 13 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "replication_set": { + "description": "Replication set name.", "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "x-order": 16 + "x-order": 5 }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", + "custom_labels": { + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 17 + "x-order": 6 + }, + "group": { + "description": "Group name of external service.", + "type": "string", + "x-order": 7 + }, + "address": { + "description": "Access address (DNS name or IP).", + "type": "string", + "x-order": 8 + }, + "port": { + "description": "Access port.", + "type": "integer", + "format": "int64", + "x-order": 9 } - }, - "x-order": 2 - }, - "qan_mysql_slowlog": { - "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + } + } + } + }, + "haproxy": { + "type": "object", + "properties": { + "external_exporter": { + "description": "ExternalExporter runs on any Node type, including Remote Node.", "type": "object", "properties": { "agent_id": { @@ -4158,13 +3992,13 @@ "type": "string", "x-order": 0 }, - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", + "runs_on_node_id": { + "description": "Node identifier where this instance runs.", "type": "string", "x-order": 1 }, "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", + "description": "If disabled, metrics from this exporter will not be collected.", "type": "boolean", "x-order": 2 }, @@ -4174,64 +4008,69 @@ "x-order": 3 }, "username": { - "description": "MySQL username for getting performance data.", + "description": "HTTP basic auth username for collecting metrics.", "type": "string", "x-order": 4 }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", + "scheme": { + "description": "Scheme to generate URI to exporter metrics endpoints.", + "type": "string", "x-order": 5 }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", + "metrics_path": { + "description": "Path under which metrics are exposed, used to generate URI.", + "type": "string", "x-order": 6 }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, "x-order": 7 }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", "x-order": 8 }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", "x-order": 9 }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", + "process_exec_path": { + "description": "Path to exec process.", + "type": "string", "x-order": 10 }, - "max_query_length": { - "type": "integer", - "format": "int32", - "title": "Limit query length in QAN (default: server-defined; -1: no limit)", - "x-order": 11 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname verification.", "type": "boolean", "x-order": 12 }, - "max_slowlog_file_size": { - "description": "Slowlog file is rotated at this size if \u003e 0.", - "type": "string", - "format": "int64", - "x-order": 13 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", + "metrics_resolutions": { + "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 + "properties": { + "hr": { + "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 0 + }, + "mr": { + "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 1 + }, + "lr": { + "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 2 + } + } }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", @@ -4246,54 +4085,12 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ], - "x-order": 15 - }, - "process_exec_path": { - "type": "string", - "title": "mod tidy", - "x-order": 16 - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "x-order": 17 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 18 + ] } - }, - "x-order": 3 + } }, - "table_count": { - "description": "Actual table count at the moment of adding.", - "type": "integer", - "format": "int32", - "x-order": 4 - } - }, - "x-order": 0 - }, - "mongodb": { - "type": "object", - "properties": { "service": { - "description": "MongoDBService represents a generic MongoDB instance.", + "description": "HAProxyService represents a generic HAProxy service instance.", "type": "object", "properties": { "service_id": { @@ -4307,40 +4104,24 @@ "x-order": 1 }, "node_id": { - "description": "Node identifier where this instance runs.", + "description": "Node identifier where this service instance runs.", "type": "string", "x-order": 2 }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 3 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 4 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 5 - }, "environment": { "description": "Environment name.", "type": "string", - "x-order": 6 + "x-order": 3 }, "cluster": { "description": "Cluster name.", "type": "string", - "x-order": 7 + "x-order": 4 }, "replication_set": { "description": "Replication set name.", "type": "string", - "x-order": 8 + "x-order": 5 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -4348,16 +4129,15 @@ "additionalProperties": { "type": "string" }, - "x-order": 9 - }, - "version": { - "description": "MongoDB version.", - "type": "string", - "x-order": 10 + "x-order": 6 } - }, - "x-order": 0 - }, + } + } + } + }, + "mongodb": { + "type": "object", + "properties": { "mongodb_exporter": { "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics.", "type": "object", @@ -4418,22 +4198,6 @@ }, "x-order": 9 }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "x-order": 10 - }, "listen_port": { "description": "Listen port for scraping metrics.", "type": "integer", @@ -4464,6 +4228,19 @@ "type": "string", "x-order": 15 }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 17 + }, + "environment_variable_names": { + "description": "Environment variable names passed to the exporter.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 19 + }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", "type": "string", @@ -4474,15 +4251,9 @@ "LOG_LEVEL_FATAL", "LOG_LEVEL_ERROR", "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "x-order": 16 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 17 + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -4503,22 +4274,27 @@ "type": "string", "x-order": 2 } - }, - "x-order": 18 + } }, - "environment_variable_names": { - "description": "Environment variable names passed to the exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 19 + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ] } - }, - "x-order": 1 + } }, - "qan_mongodb_profiler": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server.", + "qan_mongodb_mongolog": { + "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server.", "type": "object", "properties": { "agent_id": { @@ -4570,22 +4346,6 @@ }, "x-order": 8 }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "x-order": 9 - }, "process_exec_path": { "description": "Path to exec process.", "type": "string", @@ -4603,14 +4363,27 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ], - "x-order": 11 + ] + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ] } - }, - "x-order": 2 + } }, - "qan_mongodb_mongolog": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server.", + "qan_mongodb_profiler": { + "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server.", "type": "object", "properties": { "agent_id": { @@ -4662,22 +4435,6 @@ }, "x-order": 8 }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "x-order": 9 - }, "process_exec_path": { "description": "Path to exec process.", "type": "string", @@ -4695,11 +4452,24 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ], - "x-order": 11 + ] + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ] } - }, - "x-order": 3 + } }, "rta_mongodb_agent": { "description": "RTAMongoDBAgent runs within pmm-agent and sends MongoDB Real-Time Query Analytics data to the PMM Server.", @@ -4748,6 +4518,20 @@ }, "x-order": 7 }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] + }, "rta_options": { "description": "RTAOptions holds Real-Time Query Analytics agent options.", "type": "object", @@ -4757,8 +4541,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 8 + } }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", @@ -4773,35 +4556,12 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ], - "x-order": 9 - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "x-order": 10 + ] } - }, - "x-order": 4 - } - }, - "x-order": 1 - }, - "postgresql": { - "type": "object", - "properties": { + } + }, "service": { - "description": "PostgreSQLService represents a generic PostgreSQL instance.", + "description": "MongoDBService represents a generic MongoDB instance.", "type": "object", "properties": { "service_id": { @@ -4814,46 +4574,41 @@ "type": "string", "x-order": 1 }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, "node_id": { "description": "Node identifier where this instance runs.", "type": "string", - "x-order": 3 + "x-order": 2 }, "address": { "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", "type": "string", - "x-order": 4 + "x-order": 3 }, "port": { "description": "Access port.\nPort is required when the address present.", "type": "integer", "format": "int64", - "x-order": 5 + "x-order": 4 }, "socket": { "description": "Access unix socket.\nAddress (and port) or socket is required.", "type": "string", - "x-order": 6 + "x-order": 5 }, "environment": { "description": "Environment name.", "type": "string", - "x-order": 7 + "x-order": 6 }, "cluster": { "description": "Cluster name.", "type": "string", - "x-order": 8 + "x-order": 7 }, "replication_set": { "description": "Replication set name.", "type": "string", - "x-order": 9 + "x-order": 8 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -4861,24 +4616,28 @@ "additionalProperties": { "type": "string" }, - "x-order": 10 + "x-order": 9 }, "version": { - "description": "PostgreSQL version.", + "description": "MongoDB version.", "type": "string", - "x-order": 11 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 12 + "x-order": 10 } - }, - "x-order": 0 + } + } + } + }, + "mysql": { + "type": "object", + "properties": { + "table_count": { + "description": "Actual table count at the moment of adding.", + "type": "integer", + "format": "int32", + "x-order": 4 }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics.", + "mysqld_exporter": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", "type": "object", "properties": { "agent_id": { @@ -4902,7 +4661,7 @@ "x-order": 3 }, "username": { - "description": "PostgreSQL username for scraping metrics.", + "description": "MySQL username for scraping metrics.", "type": "string", "x-order": 4 }, @@ -4912,22 +4671,43 @@ "x-order": 5 }, "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", + "description": "Skip TLS certificate and hostname validation.", "type": "boolean", "x-order": 6 }, + "tls_ca": { + "description": "Certificate Authority certificate chain.", + "type": "string", + "x-order": 7 + }, + "tls_cert": { + "description": "Client certificate.", + "type": "string", + "x-order": 8 + }, + "tls_key": { + "description": "Password for decrypting tls_cert.", + "type": "string", + "x-order": 9 + }, + "tablestats_group_table_limit": { + "description": "Tablestats group collectors are disabled if there are more than that number of tables.\n0 means tablestats group collectors are always enabled (no limit).\nNegative value means tablestats group collectors are always disabled.", + "type": "integer", + "format": "int32", + "x-order": 10 + }, "custom_labels": { "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 7 + "x-order": 11 }, "push_metrics_enabled": { "description": "True if exporter uses push metrics mode.", "type": "boolean", - "x-order": 8 + "x-order": 12 }, "disabled_collectors": { "description": "List of disabled collector names.", @@ -4935,34 +4715,42 @@ "items": { "type": "string" }, - "x-order": 9 + "x-order": 13 }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "x-order": 10 + "table_count": { + "description": "Actual table count at the moment of adding.", + "type": "integer", + "format": "int32", + "x-order": 14 }, "listen_port": { "description": "Listen port for scraping metrics.", "type": "integer", "format": "int64", - "x-order": 11 + "x-order": 16 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 17 }, "process_exec_path": { "description": "Path to exec process.", "type": "string", - "x-order": 12 + "x-order": 18 + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 20 + }, + "extra_dsn_params": { + "description": "Extra DSN parameters for MySQL connection.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 22 }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", @@ -4976,25 +4764,7 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ], - "x-order": 13 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 14 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 15 - }, - "max_exporter_connections": { - "description": "Maximum number of connections that exporter can open to the database instance.", - "type": "integer", - "format": "int32", - "x-order": 16 + ] }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -5015,14 +4785,27 @@ "type": "string", "x-order": 2 } - }, - "x-order": 17 + } + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ] } - }, - "x-order": 1 + } }, - "qan_postgresql_pgstatements_agent": { - "description": "QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", + "qan_mysql_perfschema": { + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", "type": "object", "properties": { "agent_id": { @@ -5046,30 +4829,50 @@ "x-order": 3 }, "username": { - "description": "PostgreSQL username for getting pg stat statements data.", + "description": "MySQL username for getting performance data.", "type": "string", "x-order": 4 }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 5 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 6 + }, + "tls_ca": { + "description": "Certificate Authority certificate chain.", + "type": "string", + "x-order": 7 + }, + "tls_cert": { + "description": "Client certificate.", + "type": "string", + "x-order": 8 + }, + "tls_key": { + "description": "Password for decrypting tls_cert.", + "type": "string", + "x-order": 9 + }, "disable_comments_parsing": { "description": "Disable parsing comments from queries and showing them in QAN.", "type": "boolean", - "x-order": 5 + "x-order": 10 }, "max_query_length": { "description": "Limit query length in QAN (default: server-defined; -1: no limit).", "type": "integer", "format": "int32", - "x-order": 6 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 7 + "x-order": 11 }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", + "query_examples_disabled": { + "description": "True if query examples are disabled.", "type": "boolean", - "x-order": 8 + "x-order": 12 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -5077,28 +4880,20 @@ "additionalProperties": { "type": "string" }, - "x-order": 9 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "x-order": 10 + "x-order": 13 }, "process_exec_path": { "description": "Path to exec process.", "type": "string", - "x-order": 11 + "x-order": 15 + }, + "extra_dsn_params": { + "description": "Extra DSN parameters for MySQL connection.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 17 }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", @@ -5112,14 +4907,27 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ], - "x-order": 12 + ] + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ] } - }, - "x-order": 2 + } }, - "qan_postgresql_pgstatmonitor_agent": { - "description": "QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", + "qan_mysql_slowlog": { + "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", "type": "object", "properties": { "agent_id": { @@ -5143,7 +4951,7 @@ "x-order": 3 }, "username": { - "description": "PostgreSQL username for getting pg stat monitor data.", + "description": "MySQL username for getting performance data.", "type": "string", "x-order": 4 }, @@ -5157,21 +4965,42 @@ "type": "boolean", "x-order": 6 }, + "tls_ca": { + "description": "Certificate Authority certificate chain.", + "type": "string", + "x-order": 7 + }, + "tls_cert": { + "description": "Client certificate.", + "type": "string", + "x-order": 8 + }, + "tls_key": { + "description": "Password for decrypting tls_cert.", + "type": "string", + "x-order": 9 + }, "disable_comments_parsing": { "description": "Disable parsing comments from queries and showing them in QAN.", "type": "boolean", - "x-order": 7 + "x-order": 10 }, "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", "type": "integer", "format": "int32", - "x-order": 8 + "title": "Limit query length in QAN (default: server-defined; -1: no limit)", + "x-order": 11 }, "query_examples_disabled": { "description": "True if query examples are disabled.", "type": "boolean", - "x-order": 9 + "x-order": 12 + }, + "max_slowlog_file_size": { + "description": "Slowlog file is rotated at this size if \u003e 0.", + "type": "string", + "format": "int64", + "x-order": 13 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -5179,28 +5008,20 @@ "additionalProperties": { "type": "string" }, - "x-order": 10 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "x-order": 11 + "x-order": 14 }, "process_exec_path": { - "description": "Path to exec process.", "type": "string", - "x-order": 12 + "title": "mod tidy", + "x-order": 16 + }, + "extra_dsn_params": { + "description": "Extra DSN parameters for MySQL connection.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 18 }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", @@ -5214,25 +5035,27 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ], - "x-order": 13 + ] + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ] } - }, - "x-order": 3 + } }, - "warning": { - "description": "Warning message.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "proxysql": { - "type": "object", - "properties": { "service": { - "description": "ProxySQLService represents a generic ProxySQL instance.", + "description": "MySQLService represents a generic MySQL instance.", "type": "object", "properties": { "service_id": { @@ -5290,15 +5113,32 @@ "x-order": 9 }, "version": { - "description": "ProxySQL version.", + "description": "MySQL version.", "type": "string", "x-order": 10 + }, + "extra_dsn_params": { + "description": "Extra parameters to be added to the DSN.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 } - }, - "x-order": 0 + } + } + } + }, + "postgresql": { + "type": "object", + "properties": { + "warning": { + "description": "Warning message.", + "type": "string", + "x-order": 4 }, - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics.", + "postgres_exporter": { + "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics.", "type": "object", "properties": { "agent_id": { @@ -5322,7 +5162,7 @@ "x-order": 3 }, "username": { - "description": "ProxySQL username for scraping metrics.", + "description": "PostgreSQL username for scraping metrics.", "type": "string", "x-order": 4 }, @@ -5332,7 +5172,7 @@ "x-order": 5 }, "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", + "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", "type": "boolean", "x-order": 6 }, @@ -5357,22 +5197,6 @@ }, "x-order": 9 }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "x-order": 10 - }, "listen_port": { "description": "Listen port for scraping metrics.", "type": "integer", @@ -5384,6 +5208,23 @@ "type": "string", "x-order": 12 }, + "auto_discovery_limit": { + "description": "Limit of databases for auto-discovery.", + "type": "integer", + "format": "int32", + "x-order": 14 + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 15 + }, + "max_exporter_connections": { + "description": "Maximum number of connections that exporter can open to the database instance.", + "type": "integer", + "format": "int32", + "x-order": 16 + }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", "type": "string", @@ -5396,13 +5237,7 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ], - "x-order": 13 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 14 + ] }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -5423,65 +5258,27 @@ "type": "string", "x-order": 2 } - }, - "x-order": 15 - } - }, - "x-order": 1 - } - }, - "x-order": 3 - }, - "haproxy": { - "type": "object", - "properties": { - "service": { - "description": "HAProxyService represents a generic HAProxy service instance.", - "type": "object", - "properties": { - "service_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "service_name": { - "description": "Unique across all Services user-defined name.", - "type": "string", - "x-order": 1 - }, - "node_id": { - "description": "Node identifier where this service instance runs.", - "type": "string", - "x-order": 2 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 3 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 4 + } }, - "replication_set": { - "description": "Replication set name.", + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ] } - }, - "x-order": 0 + } }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", + "qan_postgresql_pgstatements_agent": { + "description": "QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", "type": "object", "properties": { "agent_id": { @@ -5489,13 +5286,13 @@ "type": "string", "x-order": 0 }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", "type": "string", "x-order": 1 }, "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", + "description": "Desired Agent status: enabled (false) or disabled (true).", "type": "boolean", "x-order": 2 }, @@ -5505,159 +5302,77 @@ "x-order": 3 }, "username": { - "description": "HTTP basic auth username for collecting metrics.", + "description": "PostgreSQL username for getting pg stat statements data.", "type": "string", "x-order": 4 }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", + "disable_comments_parsing": { + "description": "Disable parsing comments from queries and showing them in QAN.", + "type": "boolean", "x-order": 5 }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", + "max_query_length": { + "description": "Limit query length in QAN (default: server-defined; -1: no limit).", + "type": "integer", + "format": "int32", "x-order": 6 }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 7 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 8 + }, "custom_labels": { "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 7 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", "x-order": 9 }, "process_exec_path": { "description": "Path to exec process.", "type": "string", - "x-order": 10 - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 2 - } - }, "x-order": 11 }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname verification.", - "type": "boolean", - "x-order": 12 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "x-order": 13 - } - }, - "x-order": 1 - } - }, - "x-order": 4 - }, - "external": { - "type": "object", - "properties": { - "service": { - "description": "ExternalService represents a generic External service instance.", - "type": "object", - "properties": { - "service_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "service_name": { - "description": "Unique across all Services user-defined name.", - "type": "string", - "x-order": 1 - }, - "node_id": { - "description": "Node identifier where this service instance runs.", - "type": "string", - "x-order": 2 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 3 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 4 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "group": { - "description": "Group name of external service.", + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", "type": "string", - "x-order": 7 + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] }, - "address": { - "description": "Access address (DNS name or IP).", + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", "type": "string", - "x-order": 8 - }, - "port": { - "description": "Access port.", - "type": "integer", - "format": "int64", - "x-order": 9 + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ] } - }, - "x-order": 0 + } }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", + "qan_postgresql_pgstatmonitor_agent": { + "description": "QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", "type": "object", "properties": { "agent_id": { @@ -5665,13 +5380,13 @@ "type": "string", "x-order": 0 }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", "type": "string", "x-order": 1 }, "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", + "description": "Desired Agent status: enabled (false) or disabled (true).", "type": "boolean", "x-order": 2 }, @@ -5681,71 +5396,63 @@ "x-order": 3 }, "username": { - "description": "HTTP basic auth username for collecting metrics.", + "description": "PostgreSQL username for getting pg stat monitor data.", "type": "string", "x-order": 4 }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", "x-order": 5 }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", "x-order": 6 }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, + "disable_comments_parsing": { + "description": "Disable parsing comments from queries and showing them in QAN.", + "type": "boolean", "x-order": 7 }, - "listen_port": { - "description": "Listen port for scraping metrics.", + "max_query_length": { + "description": "Limit query length in QAN (default: server-defined; -1: no limit).", "type": "integer", - "format": "int64", + "format": "int32", "x-order": 8 }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", + "query_examples_disabled": { + "description": "True if query examples are disabled.", "type": "boolean", "x-order": 9 }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 10 - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", + "custom_labels": { + "description": "Custom user-assigned labels.", "type": "object", - "properties": { - "hr": { - "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 2 - } + "additionalProperties": { + "type": "string" }, - "x-order": 11 + "x-order": 10 }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname verification.", - "type": "boolean", + "process_exec_path": { + "description": "Path to exec process.", + "type": "string", "x-order": 12 }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] + }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", "type": "string", @@ -5759,70 +5466,93 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ], - "x-order": 13 + ] } - }, - "x-order": 1 - } - }, - "x-order": 5 - }, - "rds": { - "type": "object", - "properties": { - "node": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", + } + }, + "service": { + "description": "PostgreSQLService represents a generic PostgreSQL instance.", "type": "object", "properties": { - "node_id": { + "service_id": { "description": "Unique randomly generated instance identifier.", "type": "string", "x-order": 0 }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", + "service_name": { + "description": "Unique across all Services user-defined name.", "type": "string", "x-order": 1 }, - "address": { - "description": "DB instance identifier.", + "database_name": { + "description": "Database name.", "type": "string", "x-order": 2 }, - "node_model": { - "description": "Node model.", + "node_id": { + "description": "Node identifier where this instance runs.", "type": "string", "x-order": 3 }, - "region": { - "description": "Node region.", + "address": { + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", "type": "string", "x-order": 4 }, - "az": { - "description": "Node availability zone.", - "type": "string", + "port": { + "description": "Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", "x-order": 5 }, + "socket": { + "description": "Access unix socket.\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 6 + }, + "environment": { + "description": "Environment name.", + "type": "string", + "x-order": 7 + }, + "cluster": { + "description": "Cluster name.", + "type": "string", + "x-order": 8 + }, + "replication_set": { + "description": "Replication set name.", + "type": "string", + "x-order": 9 + }, "custom_labels": { "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 6 + "x-order": 10 }, - "instance_id": { - "description": "AWS instance ID.", + "version": { + "description": "PostgreSQL version.", "type": "string", - "x-order": 7 + "x-order": 11 + }, + "auto_discovery_limit": { + "description": "Limit of databases for auto-discovery.", + "type": "integer", + "format": "int32", + "x-order": 12 } - }, - "x-order": 0 - }, - "rds_exporter": { - "description": "RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics.", + } + } + } + }, + "proxysql": { + "type": "object", + "properties": { + "proxysql_exporter": { + "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics.", "type": "object", "properties": { "agent_id": { @@ -5840,65 +5570,62 @@ "type": "boolean", "x-order": 2 }, - "node_id": { - "description": "Node identifier.", + "service_id": { + "description": "Service identifier.", "type": "string", "x-order": 3 }, - "aws_access_key": { - "description": "AWS Access Key.", + "username": { + "description": "ProxySQL username for scraping metrics.", "type": "string", "x-order": 4 }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 5 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 6 + }, "custom_labels": { "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 5 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "x-order": 6 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", "x-order": 7 }, - "basic_metrics_disabled": { - "description": "Basic metrics are disabled.", + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", "type": "boolean", "x-order": 8 }, - "enhanced_metrics_disabled": { - "description": "Enhanced metrics are disabled.", - "type": "boolean", + "disabled_collectors": { + "description": "List of disabled collector names.", + "type": "array", + "items": { + "type": "string" + }, "x-order": 9 }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 10 + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 }, "process_exec_path": { "description": "Path to exec process.", "type": "string", - "x-order": 11 + "x-order": 12 + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 14 }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", @@ -5912,14 +5639,7 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ], - "x-order": 12 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 13 + ] }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -5940,12 +5660,95 @@ "type": "string", "x-order": 2 } - }, - "x-order": 14 + } + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ] } - }, - "x-order": 1 + } }, + "service": { + "description": "ProxySQLService represents a generic ProxySQL instance.", + "type": "object", + "properties": { + "service_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "service_name": { + "description": "Unique across all Services user-defined name.", + "type": "string", + "x-order": 1 + }, + "node_id": { + "description": "Node identifier where this instance runs.", + "type": "string", + "x-order": 2 + }, + "address": { + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 3 + }, + "port": { + "description": "Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", + "x-order": 4 + }, + "socket": { + "description": "Access unix socket.\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 5 + }, + "environment": { + "description": "Environment name.", + "type": "string", + "x-order": 6 + }, + "cluster": { + "description": "Cluster name.", + "type": "string", + "x-order": 7 + }, + "replication_set": { + "description": "Replication set name.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + }, + "version": { + "description": "ProxySQL version.", + "type": "string", + "x-order": 10 + } + } + } + } + }, + "rds": { + "type": "object", + "properties": { "mysql": { "description": "MySQLService represents a generic MySQL instance.", "type": "object", @@ -6017,8 +5820,7 @@ }, "x-order": 11 } - }, - "x-order": 2 + } }, "mysqld_exporter": { "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", @@ -6107,22 +5909,6 @@ "format": "int32", "x-order": 14 }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "x-order": 15 - }, "listen_port": { "description": "Listen port for scraping metrics.", "type": "integer", @@ -6137,138 +5923,55 @@ "process_exec_path": { "description": "Path to exec process.", "type": "string", - "x-order": 18 - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "x-order": 19 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 20 - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 21 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 22 - } - }, - "x-order": 3 - }, - "qan_mysql_perfschema": { - "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "MySQL username for getting performance data.", - "type": "string", - "x-order": 4 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 5 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 6 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 7 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 8 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 9 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 10 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 11 + "x-order": 18 }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", + "expose_exporter": { "type": "boolean", - "x-order": 12 + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 20 }, - "custom_labels": { - "description": "Custom user-assigned labels.", + "extra_dsn_params": { + "description": "Extra DSN parameters for MySQL connection.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 13 + "x-order": 22 + }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] + }, + "metrics_resolutions": { + "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", + "type": "object", + "properties": { + "hr": { + "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 0 + }, + "mr": { + "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 1 + }, + "lr": { + "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 2 + } + } }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", @@ -6283,39 +5986,58 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ], - "x-order": 14 + ] + } + } + }, + "node": { + "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 }, - "process_exec_path": { - "description": "Path to exec process.", + "node_name": { + "description": "Unique across all Nodes user-defined name.", "type": "string", - "x-order": 15 + "x-order": 1 }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "address": { + "description": "DB instance identifier.", "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "x-order": 16 + "x-order": 2 }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", + "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": 17 + "x-order": 6 + }, + "instance_id": { + "description": "AWS instance ID.", + "type": "string", + "x-order": 7 } - }, - "x-order": 4 + } }, "postgresql": { "description": "PostgreSQLService represents a generic PostgreSQL instance.", @@ -6391,8 +6113,7 @@ "format": "int32", "x-order": 12 } - }, - "x-order": 5 + } }, "postgresql_exporter": { "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics.", @@ -6454,6 +6175,69 @@ }, "x-order": 9 }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + }, + "process_exec_path": { + "description": "Path to exec process.", + "type": "string", + "x-order": 12 + }, + "auto_discovery_limit": { + "description": "Limit of databases for auto-discovery.", + "type": "integer", + "format": "int32", + "x-order": 14 + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 15 + }, + "max_exporter_connections": { + "description": "Maximum number of connections that exporter can open to the database instance.", + "type": "integer", + "format": "int32", + "x-order": 16 + }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] + }, + "metrics_resolutions": { + "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", + "type": "object", + "properties": { + "hr": { + "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 0 + }, + "mr": { + "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 1 + }, + "lr": { + "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 2 + } + } + }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", "type": "string", @@ -6467,19 +6251,100 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ], + ] + } + } + }, + "qan_mysql_perfschema": { + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "agent_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "service_id": { + "description": "Service identifier.", + "type": "string", + "x-order": 3 + }, + "username": { + "description": "MySQL username for getting performance data.", + "type": "string", + "x-order": 4 + }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 5 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 6 + }, + "tls_ca": { + "description": "Certificate Authority certificate chain.", + "type": "string", + "x-order": 7 + }, + "tls_cert": { + "description": "Client certificate.", + "type": "string", + "x-order": 8 + }, + "tls_key": { + "description": "Password for decrypting tls_cert.", + "type": "string", + "x-order": 9 + }, + "disable_comments_parsing": { + "description": "Disable parsing comments from queries and showing them in QAN.", + "type": "boolean", "x-order": 10 }, - "listen_port": { - "description": "Listen port for scraping metrics.", + "max_query_length": { + "description": "Limit query length in QAN (default: server-defined; -1: no limit).", "type": "integer", - "format": "int64", + "format": "int32", "x-order": 11 }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 12 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 13 + }, "process_exec_path": { "description": "Path to exec process.", "type": "string", - "x-order": 12 + "x-order": 15 + }, + "extra_dsn_params": { + "description": "Extra DSN parameters for MySQL connection.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 17 }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", @@ -6493,50 +6358,24 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ], - "x-order": 13 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 14 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 15 - }, - "max_exporter_connections": { - "description": "Maximum number of connections that exporter can open to the database instance.", - "type": "integer", - "format": "int32", - "x-order": 16 + ] }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 17 + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ] } - }, - "x-order": 6 + } }, "qan_postgresql_pgstatements": { "description": "QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", @@ -6596,6 +6435,25 @@ }, "x-order": 9 }, + "process_exec_path": { + "description": "Path to exec process.", + "type": "string", + "x-order": 11 + }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ] + }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", "type": "string", @@ -6609,7 +6467,66 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ], + ] + } + } + }, + "rds_exporter": { + "description": "RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics.", + "type": "object", + "properties": { + "agent_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "node_id": { + "description": "Node identifier.", + "type": "string", + "x-order": 3 + }, + "aws_access_key": { + "description": "AWS Access Key.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "listen_port": { + "description": "Listen port for scraping metrics (the same for several configurations).", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "basic_metrics_disabled": { + "description": "Basic metrics are disabled.", + "type": "boolean", + "x-order": 8 + }, + "enhanced_metrics_disabled": { + "description": "Enhanced metrics are disabled.", + "type": "boolean", + "x-order": 9 + }, + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", "x-order": 10 }, "process_exec_path": { @@ -6617,6 +6534,12 @@ "type": "string", "x-order": 11 }, + "auto_discovery_limit": { + "description": "Limit of databases for auto-discovery.", + "type": "integer", + "format": "int32", + "x-order": 13 + }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", "type": "string", @@ -6629,14 +6552,47 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ], - "x-order": 12 + ] + }, + "metrics_resolutions": { + "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", + "type": "object", + "properties": { + "hr": { + "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 0 + }, + "mr": { + "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 1 + }, + "lr": { + "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 2 + } + } + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ] } - }, - "x-order": 7 + } } - }, - "x-order": 6 + } }, "valkey": { "type": "object", @@ -6704,8 +6660,7 @@ "type": "string", "x-order": 10 } - }, - "x-order": 0 + } }, "valkey_exporter": { "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey Service metrics.", @@ -6767,22 +6722,6 @@ }, "x-order": 9 }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "x-order": 10 - }, "listen_port": { "description": "Listen port for scraping metrics.", "type": "integer", @@ -6818,14 +6757,26 @@ "type": "string", "x-order": 2 } - }, - "x-order": 14 + } + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ] } - }, - "x-order": 1 + } } - }, - "x-order": 7 + } } } } @@ -7013,8 +6964,7 @@ "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", "DISCOVER_AZURE_DATABASE_TYPE_MYSQL", "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" - ], - "x-order": 24 + ] } } } @@ -7226,17 +7176,6 @@ "type": "string", "x-order": 6 }, - "type": { - "description": "DiscoverAzureDatabaseType describes supported Azure Database instance engines.\n\n - DISCOVER_AZURE_DATABASE_TYPE_MYSQL: MySQL type: microsoft.dbformysql or MariaDB type: microsoft.dbformariadb\n - DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL: PostgreSQL type: microsoft.dbformysql", - "type": "string", - "default": "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", - "enum": [ - "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", - "DISCOVER_AZURE_DATABASE_TYPE_MYSQL", - "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" - ], - "x-order": 7 - }, "az": { "description": "Azure database availability zone.", "type": "string", @@ -7246,6 +7185,16 @@ "description": "Represents a purchasable Stock Keeping Unit (SKU) under a product.\nhttps://docs.microsoft.com/en-us/partner-center/develop/product-resources#sku.", "type": "string", "x-order": 9 + }, + "type": { + "description": "DiscoverAzureDatabaseType describes supported Azure Database instance engines.\n\n - DISCOVER_AZURE_DATABASE_TYPE_MYSQL: MySQL type: microsoft.dbformysql or MariaDB type: microsoft.dbformariadb\n - DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL: PostgreSQL type: microsoft.dbformysql", + "type": "string", + "default": "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", + "enum": [ + "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", + "DISCOVER_AZURE_DATABASE_TYPE_MYSQL", + "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" + ] } } }, @@ -7361,6 +7310,11 @@ "format": "int64", "x-order": 5 }, + "engine_version": { + "description": "Engine version.", + "type": "string", + "x-order": 7 + }, "engine": { "description": "DiscoverRDSEngine describes supported RDS instance engines.", "type": "string", @@ -7369,13 +7323,7 @@ "DISCOVER_RDS_ENGINE_UNSPECIFIED", "DISCOVER_RDS_ENGINE_MYSQL", "DISCOVER_RDS_ENGINE_POSTGRESQL" - ], - "x-order": 6 - }, - "engine_version": { - "description": "Engine version.", - "type": "string", - "x-order": 7 + ] } } }, diff --git a/api/management/v1/metrics.pb.go b/api/management/v1/metrics.pb.go index af41e8e2ebb..4e15adc6171 100644 --- a/api/management/v1/metrics.pb.go +++ b/api/management/v1/metrics.pb.go @@ -7,12 +7,11 @@ package managementv1 import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -97,13 +96,10 @@ func file_management_v1_metrics_proto_rawDescGZIP() []byte { return file_management_v1_metrics_proto_rawDescData } -var ( - file_management_v1_metrics_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_management_v1_metrics_proto_goTypes = []any{ - (MetricsMode)(0), // 0: management.v1.MetricsMode - } -) - +var file_management_v1_metrics_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_management_v1_metrics_proto_goTypes = []any{ + (MetricsMode)(0), // 0: management.v1.MetricsMode +} var file_management_v1_metrics_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/management/v1/metrics.swagger.json b/api/management/v1/metrics.swagger.json new file mode 100644 index 00000000000..48c8c4ec4ca --- /dev/null +++ b/api/management/v1/metrics.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/metrics.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/management/v1/mongodb.pb.go b/api/management/v1/mongodb.pb.go index 5fc9584c35c..371190431cf 100644 --- a/api/management/v1/mongodb.pb.go +++ b/api/management/v1/mongodb.pb.go @@ -7,15 +7,13 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" + v1 "github.com/percona/pmm/api/inventory/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -530,23 +528,20 @@ func file_management_v1_mongodb_proto_rawDescGZIP() []byte { return file_management_v1_mongodb_proto_rawDescData } -var ( - file_management_v1_mongodb_proto_msgTypes = make([]protoimpl.MessageInfo, 3) - file_management_v1_mongodb_proto_goTypes = []any{ - (*AddMongoDBServiceParams)(nil), // 0: management.v1.AddMongoDBServiceParams - (*MongoDBServiceResult)(nil), // 1: management.v1.MongoDBServiceResult - nil, // 2: management.v1.AddMongoDBServiceParams.CustomLabelsEntry - (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams - (MetricsMode)(0), // 4: management.v1.MetricsMode - (v1.LogLevel)(0), // 5: inventory.v1.LogLevel - (*v1.MongoDBService)(nil), // 6: inventory.v1.MongoDBService - (*v1.MongoDBExporter)(nil), // 7: inventory.v1.MongoDBExporter - (*v1.QANMongoDBProfilerAgent)(nil), // 8: inventory.v1.QANMongoDBProfilerAgent - (*v1.QANMongoDBMongologAgent)(nil), // 9: inventory.v1.QANMongoDBMongologAgent - (*v1.RTAMongoDBAgent)(nil), // 10: inventory.v1.RTAMongoDBAgent - } -) - +var file_management_v1_mongodb_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_management_v1_mongodb_proto_goTypes = []any{ + (*AddMongoDBServiceParams)(nil), // 0: management.v1.AddMongoDBServiceParams + (*MongoDBServiceResult)(nil), // 1: management.v1.MongoDBServiceResult + nil, // 2: management.v1.AddMongoDBServiceParams.CustomLabelsEntry + (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams + (MetricsMode)(0), // 4: management.v1.MetricsMode + (v1.LogLevel)(0), // 5: inventory.v1.LogLevel + (*v1.MongoDBService)(nil), // 6: inventory.v1.MongoDBService + (*v1.MongoDBExporter)(nil), // 7: inventory.v1.MongoDBExporter + (*v1.QANMongoDBProfilerAgent)(nil), // 8: inventory.v1.QANMongoDBProfilerAgent + (*v1.QANMongoDBMongologAgent)(nil), // 9: inventory.v1.QANMongoDBMongologAgent + (*v1.RTAMongoDBAgent)(nil), // 10: inventory.v1.RTAMongoDBAgent +} var file_management_v1_mongodb_proto_depIdxs = []int32{ 3, // 0: management.v1.AddMongoDBServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddMongoDBServiceParams.custom_labels:type_name -> management.v1.AddMongoDBServiceParams.CustomLabelsEntry diff --git a/api/management/v1/mongodb.swagger.json b/api/management/v1/mongodb.swagger.json new file mode 100644 index 00000000000..2722b769cf7 --- /dev/null +++ b/api/management/v1/mongodb.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/mongodb.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/management/v1/mysql.pb.go b/api/management/v1/mysql.pb.go index 880618f4403..97ee6ed09fb 100644 --- a/api/management/v1/mysql.pb.go +++ b/api/management/v1/mysql.pb.go @@ -7,15 +7,13 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" + v1 "github.com/percona/pmm/api/inventory/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -516,23 +514,20 @@ func file_management_v1_mysql_proto_rawDescGZIP() []byte { return file_management_v1_mysql_proto_rawDescData } -var ( - file_management_v1_mysql_proto_msgTypes = make([]protoimpl.MessageInfo, 4) - file_management_v1_mysql_proto_goTypes = []any{ - (*AddMySQLServiceParams)(nil), // 0: management.v1.AddMySQLServiceParams - (*MySQLServiceResult)(nil), // 1: management.v1.MySQLServiceResult - nil, // 2: management.v1.AddMySQLServiceParams.CustomLabelsEntry - nil, // 3: management.v1.AddMySQLServiceParams.ExtraDsnParamsEntry - (*AddNodeParams)(nil), // 4: management.v1.AddNodeParams - (MetricsMode)(0), // 5: management.v1.MetricsMode - (v1.LogLevel)(0), // 6: inventory.v1.LogLevel - (*v1.MySQLService)(nil), // 7: inventory.v1.MySQLService - (*v1.MySQLdExporter)(nil), // 8: inventory.v1.MySQLdExporter - (*v1.QANMySQLPerfSchemaAgent)(nil), // 9: inventory.v1.QANMySQLPerfSchemaAgent - (*v1.QANMySQLSlowlogAgent)(nil), // 10: inventory.v1.QANMySQLSlowlogAgent - } -) - +var file_management_v1_mysql_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_management_v1_mysql_proto_goTypes = []any{ + (*AddMySQLServiceParams)(nil), // 0: management.v1.AddMySQLServiceParams + (*MySQLServiceResult)(nil), // 1: management.v1.MySQLServiceResult + nil, // 2: management.v1.AddMySQLServiceParams.CustomLabelsEntry + nil, // 3: management.v1.AddMySQLServiceParams.ExtraDsnParamsEntry + (*AddNodeParams)(nil), // 4: management.v1.AddNodeParams + (MetricsMode)(0), // 5: management.v1.MetricsMode + (v1.LogLevel)(0), // 6: inventory.v1.LogLevel + (*v1.MySQLService)(nil), // 7: inventory.v1.MySQLService + (*v1.MySQLdExporter)(nil), // 8: inventory.v1.MySQLdExporter + (*v1.QANMySQLPerfSchemaAgent)(nil), // 9: inventory.v1.QANMySQLPerfSchemaAgent + (*v1.QANMySQLSlowlogAgent)(nil), // 10: inventory.v1.QANMySQLSlowlogAgent +} var file_management_v1_mysql_proto_depIdxs = []int32{ 4, // 0: management.v1.AddMySQLServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddMySQLServiceParams.custom_labels:type_name -> management.v1.AddMySQLServiceParams.CustomLabelsEntry diff --git a/api/management/v1/mysql.swagger.json b/api/management/v1/mysql.swagger.json new file mode 100644 index 00000000000..f0be3fa24f2 --- /dev/null +++ b/api/management/v1/mysql.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/mysql.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/management/v1/node.pb.go b/api/management/v1/node.pb.go index 8915b579dfd..1af3670f2e7 100644 --- a/api/management/v1/node.pb.go +++ b/api/management/v1/node.pb.go @@ -7,16 +7,14 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" + v1 "github.com/percona/pmm/api/inventory/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -963,6 +961,125 @@ func (x *GetNodeResponse) GetNode() *UniversalNode { return nil } +// CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash). +type CreateNodeInstallTokenRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Token TTL in seconds; 0 means use server default. Server clamps to a maximum. + TtlSeconds uint32 `protobuf:"varint,1,opt,name=ttl_seconds,json=ttlSeconds,proto3" json:"ttl_seconds,omitempty"` + // Technology for install script TECH env (e.g. mysql, postgresql, mongodb). + Technology string `protobuf:"bytes,2,opt,name=technology,proto3" json:"technology,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateNodeInstallTokenRequest) Reset() { + *x = CreateNodeInstallTokenRequest{} + mi := &file_management_v1_node_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateNodeInstallTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateNodeInstallTokenRequest) ProtoMessage() {} + +func (x *CreateNodeInstallTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_management_v1_node_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateNodeInstallTokenRequest.ProtoReflect.Descriptor instead. +func (*CreateNodeInstallTokenRequest) Descriptor() ([]byte, []int) { + return file_management_v1_node_proto_rawDescGZIP(), []int{10} +} + +func (x *CreateNodeInstallTokenRequest) GetTtlSeconds() uint32 { + if x != nil { + return x.TtlSeconds + } + return 0 +} + +func (x *CreateNodeInstallTokenRequest) GetTechnology() string { + if x != nil { + return x.Technology + } + return "" +} + +// CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL. +type CreateNodeInstallTokenResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Plaintext token for PMM_SERVER_URL userinfo (service_token:). + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + // Expiration time of the token (derived from TTL). + ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + // Grafana service account id created for this install token flow. + ServiceAccountId int64 `protobuf:"varint,3,opt,name=service_account_id,json=serviceAccountId,proto3" json:"service_account_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateNodeInstallTokenResponse) Reset() { + *x = CreateNodeInstallTokenResponse{} + mi := &file_management_v1_node_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateNodeInstallTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateNodeInstallTokenResponse) ProtoMessage() {} + +func (x *CreateNodeInstallTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_management_v1_node_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateNodeInstallTokenResponse.ProtoReflect.Descriptor instead. +func (*CreateNodeInstallTokenResponse) Descriptor() ([]byte, []int) { + return file_management_v1_node_proto_rawDescGZIP(), []int{11} +} + +func (x *CreateNodeInstallTokenResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *CreateNodeInstallTokenResponse) GetExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.ExpiresAt + } + return nil +} + +func (x *CreateNodeInstallTokenResponse) GetServiceAccountId() int64 { + if x != nil { + return x.ServiceAccountId + } + return 0 +} + // Service represents a service running on a node. type UniversalNode_Service struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -978,7 +1095,7 @@ type UniversalNode_Service struct { func (x *UniversalNode_Service) Reset() { *x = UniversalNode_Service{} - mi := &file_management_v1_node_proto_msgTypes[12] + mi := &file_management_v1_node_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -990,7 +1107,7 @@ func (x *UniversalNode_Service) String() string { func (*UniversalNode_Service) ProtoMessage() {} func (x *UniversalNode_Service) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[12] + mi := &file_management_v1_node_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1043,7 +1160,7 @@ type UniversalNode_Agent struct { func (x *UniversalNode_Agent) Reset() { *x = UniversalNode_Agent{} - mi := &file_management_v1_node_proto_msgTypes[13] + mi := &file_management_v1_node_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1055,7 +1172,7 @@ func (x *UniversalNode_Agent) String() string { func (*UniversalNode_Agent) ProtoMessage() {} func (x *UniversalNode_Agent) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[13] + mi := &file_management_v1_node_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1211,7 +1328,18 @@ const file_management_v1_node_proto_rawDesc = "" + "\x0eGetNodeRequest\x12 \n" + "\anode_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\"C\n" + "\x0fGetNodeResponse\x120\n" + - "\x04node\x18\x01 \x01(\v2\x1c.management.v1.UniversalNodeR\x04nodeB\xaa\x01\n" + + "\x04node\x18\x01 \x01(\v2\x1c.management.v1.UniversalNodeR\x04node\"`\n" + + "\x1dCreateNodeInstallTokenRequest\x12\x1f\n" + + "\vttl_seconds\x18\x01 \x01(\rR\n" + + "ttlSeconds\x12\x1e\n" + + "\n" + + "technology\x18\x02 \x01(\tR\n" + + "technology\"\x9f\x01\n" + + "\x1eCreateNodeInstallTokenResponse\x12\x14\n" + + "\x05token\x18\x01 \x01(\tR\x05token\x129\n" + + "\n" + + "expires_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\x12,\n" + + "\x12service_account_id\x18\x03 \x01(\x03R\x10serviceAccountIdB\xaa\x01\n" + "\x11com.management.v1B\tNodeProtoP\x01Z5github.com/percona/pmm/api/management/v1;managementv1\xa2\x02\x03MXX\xaa\x02\rManagement.V1\xca\x02\rManagement\\V1\xe2\x02\x19Management\\V1\\GPBMetadata\xea\x02\x0eManagement::V1b\x06proto3" var ( @@ -1226,58 +1354,58 @@ func file_management_v1_node_proto_rawDescGZIP() []byte { return file_management_v1_node_proto_rawDescData } -var ( - file_management_v1_node_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_management_v1_node_proto_msgTypes = make([]protoimpl.MessageInfo, 15) - file_management_v1_node_proto_goTypes = []any{ - (UniversalNode_Status)(0), // 0: management.v1.UniversalNode.Status - (*AddNodeParams)(nil), // 1: management.v1.AddNodeParams - (*RegisterNodeRequest)(nil), // 2: management.v1.RegisterNodeRequest - (*RegisterNodeResponse)(nil), // 3: management.v1.RegisterNodeResponse - (*UnregisterNodeRequest)(nil), // 4: management.v1.UnregisterNodeRequest - (*UnregisterNodeResponse)(nil), // 5: management.v1.UnregisterNodeResponse - (*UniversalNode)(nil), // 6: management.v1.UniversalNode - (*ListNodesRequest)(nil), // 7: management.v1.ListNodesRequest - (*ListNodesResponse)(nil), // 8: management.v1.ListNodesResponse - (*GetNodeRequest)(nil), // 9: management.v1.GetNodeRequest - (*GetNodeResponse)(nil), // 10: management.v1.GetNodeResponse - nil, // 11: management.v1.AddNodeParams.CustomLabelsEntry - nil, // 12: management.v1.RegisterNodeRequest.CustomLabelsEntry - (*UniversalNode_Service)(nil), // 13: management.v1.UniversalNode.Service - (*UniversalNode_Agent)(nil), // 14: management.v1.UniversalNode.Agent - nil, // 15: management.v1.UniversalNode.CustomLabelsEntry - (v1.NodeType)(0), // 16: inventory.v1.NodeType - (MetricsMode)(0), // 17: management.v1.MetricsMode - (*v1.GenericNode)(nil), // 18: inventory.v1.GenericNode - (*v1.ContainerNode)(nil), // 19: inventory.v1.ContainerNode - (*v1.PMMAgent)(nil), // 20: inventory.v1.PMMAgent - (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp - } -) - +var file_management_v1_node_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_management_v1_node_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_management_v1_node_proto_goTypes = []any{ + (UniversalNode_Status)(0), // 0: management.v1.UniversalNode.Status + (*AddNodeParams)(nil), // 1: management.v1.AddNodeParams + (*RegisterNodeRequest)(nil), // 2: management.v1.RegisterNodeRequest + (*RegisterNodeResponse)(nil), // 3: management.v1.RegisterNodeResponse + (*UnregisterNodeRequest)(nil), // 4: management.v1.UnregisterNodeRequest + (*UnregisterNodeResponse)(nil), // 5: management.v1.UnregisterNodeResponse + (*UniversalNode)(nil), // 6: management.v1.UniversalNode + (*ListNodesRequest)(nil), // 7: management.v1.ListNodesRequest + (*ListNodesResponse)(nil), // 8: management.v1.ListNodesResponse + (*GetNodeRequest)(nil), // 9: management.v1.GetNodeRequest + (*GetNodeResponse)(nil), // 10: management.v1.GetNodeResponse + (*CreateNodeInstallTokenRequest)(nil), // 11: management.v1.CreateNodeInstallTokenRequest + (*CreateNodeInstallTokenResponse)(nil), // 12: management.v1.CreateNodeInstallTokenResponse + nil, // 13: management.v1.AddNodeParams.CustomLabelsEntry + nil, // 14: management.v1.RegisterNodeRequest.CustomLabelsEntry + (*UniversalNode_Service)(nil), // 15: management.v1.UniversalNode.Service + (*UniversalNode_Agent)(nil), // 16: management.v1.UniversalNode.Agent + nil, // 17: management.v1.UniversalNode.CustomLabelsEntry + (v1.NodeType)(0), // 18: inventory.v1.NodeType + (MetricsMode)(0), // 19: management.v1.MetricsMode + (*v1.GenericNode)(nil), // 20: inventory.v1.GenericNode + (*v1.ContainerNode)(nil), // 21: inventory.v1.ContainerNode + (*v1.PMMAgent)(nil), // 22: inventory.v1.PMMAgent + (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp +} var file_management_v1_node_proto_depIdxs = []int32{ - 16, // 0: management.v1.AddNodeParams.node_type:type_name -> inventory.v1.NodeType - 11, // 1: management.v1.AddNodeParams.custom_labels:type_name -> management.v1.AddNodeParams.CustomLabelsEntry - 16, // 2: management.v1.RegisterNodeRequest.node_type:type_name -> inventory.v1.NodeType - 12, // 3: management.v1.RegisterNodeRequest.custom_labels:type_name -> management.v1.RegisterNodeRequest.CustomLabelsEntry - 17, // 4: management.v1.RegisterNodeRequest.metrics_mode:type_name -> management.v1.MetricsMode - 18, // 5: management.v1.RegisterNodeResponse.generic_node:type_name -> inventory.v1.GenericNode - 19, // 6: management.v1.RegisterNodeResponse.container_node:type_name -> inventory.v1.ContainerNode - 20, // 7: management.v1.RegisterNodeResponse.pmm_agent:type_name -> inventory.v1.PMMAgent - 15, // 8: management.v1.UniversalNode.custom_labels:type_name -> management.v1.UniversalNode.CustomLabelsEntry - 21, // 9: management.v1.UniversalNode.created_at:type_name -> google.protobuf.Timestamp - 21, // 10: management.v1.UniversalNode.updated_at:type_name -> google.protobuf.Timestamp + 18, // 0: management.v1.AddNodeParams.node_type:type_name -> inventory.v1.NodeType + 13, // 1: management.v1.AddNodeParams.custom_labels:type_name -> management.v1.AddNodeParams.CustomLabelsEntry + 18, // 2: management.v1.RegisterNodeRequest.node_type:type_name -> inventory.v1.NodeType + 14, // 3: management.v1.RegisterNodeRequest.custom_labels:type_name -> management.v1.RegisterNodeRequest.CustomLabelsEntry + 19, // 4: management.v1.RegisterNodeRequest.metrics_mode:type_name -> management.v1.MetricsMode + 20, // 5: management.v1.RegisterNodeResponse.generic_node:type_name -> inventory.v1.GenericNode + 21, // 6: management.v1.RegisterNodeResponse.container_node:type_name -> inventory.v1.ContainerNode + 22, // 7: management.v1.RegisterNodeResponse.pmm_agent:type_name -> inventory.v1.PMMAgent + 17, // 8: management.v1.UniversalNode.custom_labels:type_name -> management.v1.UniversalNode.CustomLabelsEntry + 23, // 9: management.v1.UniversalNode.created_at:type_name -> google.protobuf.Timestamp + 23, // 10: management.v1.UniversalNode.updated_at:type_name -> google.protobuf.Timestamp 0, // 11: management.v1.UniversalNode.status:type_name -> management.v1.UniversalNode.Status - 14, // 12: management.v1.UniversalNode.agents:type_name -> management.v1.UniversalNode.Agent - 13, // 13: management.v1.UniversalNode.services:type_name -> management.v1.UniversalNode.Service - 16, // 14: management.v1.ListNodesRequest.node_type:type_name -> inventory.v1.NodeType + 16, // 12: management.v1.UniversalNode.agents:type_name -> management.v1.UniversalNode.Agent + 15, // 13: management.v1.UniversalNode.services:type_name -> management.v1.UniversalNode.Service + 18, // 14: management.v1.ListNodesRequest.node_type:type_name -> inventory.v1.NodeType 6, // 15: management.v1.ListNodesResponse.nodes:type_name -> management.v1.UniversalNode 6, // 16: management.v1.GetNodeResponse.node:type_name -> management.v1.UniversalNode - 17, // [17:17] is the sub-list for method output_type - 17, // [17:17] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 23, // 17: management.v1.CreateNodeInstallTokenResponse.expires_at:type_name -> google.protobuf.Timestamp + 18, // [18:18] is the sub-list for method output_type + 18, // [18:18] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_management_v1_node_proto_init() } @@ -1292,7 +1420,7 @@ func file_management_v1_node_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_node_proto_rawDesc), len(file_management_v1_node_proto_rawDesc)), NumEnums: 1, - NumMessages: 15, + NumMessages: 17, NumExtensions: 0, NumServices: 0, }, diff --git a/api/management/v1/node.pb.validate.go b/api/management/v1/node.pb.validate.go index 62a389ade8a..c87c75bf9c6 100644 --- a/api/management/v1/node.pb.validate.go +++ b/api/management/v1/node.pb.validate.go @@ -1457,6 +1457,249 @@ var _ interface { ErrorName() string } = GetNodeResponseValidationError{} +// Validate checks the field values on CreateNodeInstallTokenRequest 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 *CreateNodeInstallTokenRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateNodeInstallTokenRequest 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 +// CreateNodeInstallTokenRequestMultiError, or nil if none found. +func (m *CreateNodeInstallTokenRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateNodeInstallTokenRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for TtlSeconds + + // no validation rules for Technology + + if len(errors) > 0 { + return CreateNodeInstallTokenRequestMultiError(errors) + } + + return nil +} + +// CreateNodeInstallTokenRequestMultiError is an error wrapping multiple +// validation errors returned by CreateNodeInstallTokenRequest.ValidateAll() +// if the designated constraints aren't met. +type CreateNodeInstallTokenRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateNodeInstallTokenRequestMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateNodeInstallTokenRequestMultiError) AllErrors() []error { return m } + +// CreateNodeInstallTokenRequestValidationError is the validation error +// returned by CreateNodeInstallTokenRequest.Validate if the designated +// constraints aren't met. +type CreateNodeInstallTokenRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateNodeInstallTokenRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateNodeInstallTokenRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateNodeInstallTokenRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateNodeInstallTokenRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateNodeInstallTokenRequestValidationError) ErrorName() string { + return "CreateNodeInstallTokenRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateNodeInstallTokenRequestValidationError) 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 %sCreateNodeInstallTokenRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateNodeInstallTokenRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateNodeInstallTokenRequestValidationError{} + +// Validate checks the field values on CreateNodeInstallTokenResponse 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 *CreateNodeInstallTokenResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateNodeInstallTokenResponse 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 +// CreateNodeInstallTokenResponseMultiError, or nil if none found. +func (m *CreateNodeInstallTokenResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateNodeInstallTokenResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Token + + if all { + switch v := interface{}(m.GetExpiresAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateNodeInstallTokenResponseValidationError{ + field: "ExpiresAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateNodeInstallTokenResponseValidationError{ + field: "ExpiresAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetExpiresAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateNodeInstallTokenResponseValidationError{ + field: "ExpiresAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for ServiceAccountId + + if len(errors) > 0 { + return CreateNodeInstallTokenResponseMultiError(errors) + } + + return nil +} + +// CreateNodeInstallTokenResponseMultiError is an error wrapping multiple +// validation errors returned by CreateNodeInstallTokenResponse.ValidateAll() +// if the designated constraints aren't met. +type CreateNodeInstallTokenResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateNodeInstallTokenResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateNodeInstallTokenResponseMultiError) AllErrors() []error { return m } + +// CreateNodeInstallTokenResponseValidationError is the validation error +// returned by CreateNodeInstallTokenResponse.Validate if the designated +// constraints aren't met. +type CreateNodeInstallTokenResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateNodeInstallTokenResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateNodeInstallTokenResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateNodeInstallTokenResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateNodeInstallTokenResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateNodeInstallTokenResponseValidationError) ErrorName() string { + return "CreateNodeInstallTokenResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateNodeInstallTokenResponseValidationError) 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 %sCreateNodeInstallTokenResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateNodeInstallTokenResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateNodeInstallTokenResponseValidationError{} + // Validate checks the field values on UniversalNode_Service 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/management/v1/node.proto b/api/management/v1/node.proto index 74b16d47f3a..251ee7b86cd 100644 --- a/api/management/v1/node.proto +++ b/api/management/v1/node.proto @@ -183,3 +183,21 @@ message GetNodeRequest { message GetNodeResponse { UniversalNode node = 1; } + +// CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash). +message CreateNodeInstallTokenRequest { + // Token TTL in seconds; 0 means use server default. Server clamps to a maximum. + uint32 ttl_seconds = 1; + // Technology for install script TECH env (e.g. mysql, postgresql, mongodb). + string technology = 2; +} + +// CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL. +message CreateNodeInstallTokenResponse { + // Plaintext token for PMM_SERVER_URL userinfo (service_token:). + string token = 1; + // Expiration time of the token (derived from TTL). + google.protobuf.Timestamp expires_at = 2; + // Grafana service account id created for this install token flow. + int64 service_account_id = 3; +} diff --git a/api/management/v1/node.swagger.json b/api/management/v1/node.swagger.json new file mode 100644 index 00000000000..87f7e2581d0 --- /dev/null +++ b/api/management/v1/node.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/node.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/management/v1/postgresql.pb.go b/api/management/v1/postgresql.pb.go index 20b9fe29eaf..d575b00544a 100644 --- a/api/management/v1/postgresql.pb.go +++ b/api/management/v1/postgresql.pb.go @@ -7,15 +7,13 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" + v1 "github.com/percona/pmm/api/inventory/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -507,22 +505,19 @@ func file_management_v1_postgresql_proto_rawDescGZIP() []byte { return file_management_v1_postgresql_proto_rawDescData } -var ( - file_management_v1_postgresql_proto_msgTypes = make([]protoimpl.MessageInfo, 3) - file_management_v1_postgresql_proto_goTypes = []any{ - (*AddPostgreSQLServiceParams)(nil), // 0: management.v1.AddPostgreSQLServiceParams - (*PostgreSQLServiceResult)(nil), // 1: management.v1.PostgreSQLServiceResult - nil, // 2: management.v1.AddPostgreSQLServiceParams.CustomLabelsEntry - (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams - (MetricsMode)(0), // 4: management.v1.MetricsMode - (v1.LogLevel)(0), // 5: inventory.v1.LogLevel - (*v1.PostgreSQLService)(nil), // 6: inventory.v1.PostgreSQLService - (*v1.PostgresExporter)(nil), // 7: inventory.v1.PostgresExporter - (*v1.QANPostgreSQLPgStatementsAgent)(nil), // 8: inventory.v1.QANPostgreSQLPgStatementsAgent - (*v1.QANPostgreSQLPgStatMonitorAgent)(nil), // 9: inventory.v1.QANPostgreSQLPgStatMonitorAgent - } -) - +var file_management_v1_postgresql_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_management_v1_postgresql_proto_goTypes = []any{ + (*AddPostgreSQLServiceParams)(nil), // 0: management.v1.AddPostgreSQLServiceParams + (*PostgreSQLServiceResult)(nil), // 1: management.v1.PostgreSQLServiceResult + nil, // 2: management.v1.AddPostgreSQLServiceParams.CustomLabelsEntry + (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams + (MetricsMode)(0), // 4: management.v1.MetricsMode + (v1.LogLevel)(0), // 5: inventory.v1.LogLevel + (*v1.PostgreSQLService)(nil), // 6: inventory.v1.PostgreSQLService + (*v1.PostgresExporter)(nil), // 7: inventory.v1.PostgresExporter + (*v1.QANPostgreSQLPgStatementsAgent)(nil), // 8: inventory.v1.QANPostgreSQLPgStatementsAgent + (*v1.QANPostgreSQLPgStatMonitorAgent)(nil), // 9: inventory.v1.QANPostgreSQLPgStatMonitorAgent +} var file_management_v1_postgresql_proto_depIdxs = []int32{ 3, // 0: management.v1.AddPostgreSQLServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddPostgreSQLServiceParams.custom_labels:type_name -> management.v1.AddPostgreSQLServiceParams.CustomLabelsEntry diff --git a/api/management/v1/postgresql.swagger.json b/api/management/v1/postgresql.swagger.json new file mode 100644 index 00000000000..a4694fd37f7 --- /dev/null +++ b/api/management/v1/postgresql.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/postgresql.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/management/v1/proxysql.pb.go b/api/management/v1/proxysql.pb.go index df8c4011336..e9d5678db43 100644 --- a/api/management/v1/proxysql.pb.go +++ b/api/management/v1/proxysql.pb.go @@ -7,15 +7,13 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" + v1 "github.com/percona/pmm/api/inventory/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -369,20 +367,17 @@ func file_management_v1_proxysql_proto_rawDescGZIP() []byte { return file_management_v1_proxysql_proto_rawDescData } -var ( - file_management_v1_proxysql_proto_msgTypes = make([]protoimpl.MessageInfo, 3) - file_management_v1_proxysql_proto_goTypes = []any{ - (*AddProxySQLServiceParams)(nil), // 0: management.v1.AddProxySQLServiceParams - (*ProxySQLServiceResult)(nil), // 1: management.v1.ProxySQLServiceResult - nil, // 2: management.v1.AddProxySQLServiceParams.CustomLabelsEntry - (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams - (MetricsMode)(0), // 4: management.v1.MetricsMode - (v1.LogLevel)(0), // 5: inventory.v1.LogLevel - (*v1.ProxySQLService)(nil), // 6: inventory.v1.ProxySQLService - (*v1.ProxySQLExporter)(nil), // 7: inventory.v1.ProxySQLExporter - } -) - +var file_management_v1_proxysql_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_management_v1_proxysql_proto_goTypes = []any{ + (*AddProxySQLServiceParams)(nil), // 0: management.v1.AddProxySQLServiceParams + (*ProxySQLServiceResult)(nil), // 1: management.v1.ProxySQLServiceResult + nil, // 2: management.v1.AddProxySQLServiceParams.CustomLabelsEntry + (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams + (MetricsMode)(0), // 4: management.v1.MetricsMode + (v1.LogLevel)(0), // 5: inventory.v1.LogLevel + (*v1.ProxySQLService)(nil), // 6: inventory.v1.ProxySQLService + (*v1.ProxySQLExporter)(nil), // 7: inventory.v1.ProxySQLExporter +} var file_management_v1_proxysql_proto_depIdxs = []int32{ 3, // 0: management.v1.AddProxySQLServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddProxySQLServiceParams.custom_labels:type_name -> management.v1.AddProxySQLServiceParams.CustomLabelsEntry diff --git a/api/management/v1/proxysql.swagger.json b/api/management/v1/proxysql.swagger.json new file mode 100644 index 00000000000..64f40cbe45f --- /dev/null +++ b/api/management/v1/proxysql.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/proxysql.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/management/v1/rds.pb.go b/api/management/v1/rds.pb.go index 6f8449b00ab..fd77ebf9cb3 100644 --- a/api/management/v1/rds.pb.go +++ b/api/management/v1/rds.pb.go @@ -7,15 +7,13 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" + v1 "github.com/percona/pmm/api/inventory/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -819,29 +817,26 @@ func file_management_v1_rds_proto_rawDescGZIP() []byte { return file_management_v1_rds_proto_rawDescData } -var ( - file_management_v1_rds_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_management_v1_rds_proto_msgTypes = make([]protoimpl.MessageInfo, 6) - file_management_v1_rds_proto_goTypes = []any{ - (DiscoverRDSEngine)(0), // 0: management.v1.DiscoverRDSEngine - (*DiscoverRDSInstance)(nil), // 1: management.v1.DiscoverRDSInstance - (*DiscoverRDSRequest)(nil), // 2: management.v1.DiscoverRDSRequest - (*DiscoverRDSResponse)(nil), // 3: management.v1.DiscoverRDSResponse - (*AddRDSServiceParams)(nil), // 4: management.v1.AddRDSServiceParams - (*RDSServiceResult)(nil), // 5: management.v1.RDSServiceResult - nil, // 6: management.v1.AddRDSServiceParams.CustomLabelsEntry - (MetricsMode)(0), // 7: management.v1.MetricsMode - (*v1.RemoteRDSNode)(nil), // 8: inventory.v1.RemoteRDSNode - (*v1.RDSExporter)(nil), // 9: inventory.v1.RDSExporter - (*v1.MySQLService)(nil), // 10: inventory.v1.MySQLService - (*v1.MySQLdExporter)(nil), // 11: inventory.v1.MySQLdExporter - (*v1.QANMySQLPerfSchemaAgent)(nil), // 12: inventory.v1.QANMySQLPerfSchemaAgent - (*v1.PostgreSQLService)(nil), // 13: inventory.v1.PostgreSQLService - (*v1.PostgresExporter)(nil), // 14: inventory.v1.PostgresExporter - (*v1.QANPostgreSQLPgStatementsAgent)(nil), // 15: inventory.v1.QANPostgreSQLPgStatementsAgent - } -) - +var file_management_v1_rds_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_management_v1_rds_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_management_v1_rds_proto_goTypes = []any{ + (DiscoverRDSEngine)(0), // 0: management.v1.DiscoverRDSEngine + (*DiscoverRDSInstance)(nil), // 1: management.v1.DiscoverRDSInstance + (*DiscoverRDSRequest)(nil), // 2: management.v1.DiscoverRDSRequest + (*DiscoverRDSResponse)(nil), // 3: management.v1.DiscoverRDSResponse + (*AddRDSServiceParams)(nil), // 4: management.v1.AddRDSServiceParams + (*RDSServiceResult)(nil), // 5: management.v1.RDSServiceResult + nil, // 6: management.v1.AddRDSServiceParams.CustomLabelsEntry + (MetricsMode)(0), // 7: management.v1.MetricsMode + (*v1.RemoteRDSNode)(nil), // 8: inventory.v1.RemoteRDSNode + (*v1.RDSExporter)(nil), // 9: inventory.v1.RDSExporter + (*v1.MySQLService)(nil), // 10: inventory.v1.MySQLService + (*v1.MySQLdExporter)(nil), // 11: inventory.v1.MySQLdExporter + (*v1.QANMySQLPerfSchemaAgent)(nil), // 12: inventory.v1.QANMySQLPerfSchemaAgent + (*v1.PostgreSQLService)(nil), // 13: inventory.v1.PostgreSQLService + (*v1.PostgresExporter)(nil), // 14: inventory.v1.PostgresExporter + (*v1.QANPostgreSQLPgStatementsAgent)(nil), // 15: inventory.v1.QANPostgreSQLPgStatementsAgent +} var file_management_v1_rds_proto_depIdxs = []int32{ 0, // 0: management.v1.DiscoverRDSInstance.engine:type_name -> management.v1.DiscoverRDSEngine 1, // 1: management.v1.DiscoverRDSResponse.rds_instances:type_name -> management.v1.DiscoverRDSInstance diff --git a/api/management/v1/rds.swagger.json b/api/management/v1/rds.swagger.json new file mode 100644 index 00000000000..a03802476a3 --- /dev/null +++ b/api/management/v1/rds.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/rds.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/management/v1/service.pb.go b/api/management/v1/service.pb.go index b1c2fa98c9a..5d462db7731 100644 --- a/api/management/v1/service.pb.go +++ b/api/management/v1/service.pb.go @@ -7,17 +7,15 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + v1 "github.com/percona/pmm/api/inventory/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -919,7 +917,7 @@ const file_management_v1_service_proto_rawDesc = "" + "\fservice_type\x18\x02 \x01(\x0e2\x19.inventory.v1.ServiceTypeR\vserviceType\x12%\n" + "\x0eexternal_group\x18\x03 \x01(\tR\rexternalGroup\"S\n" + "\x14ListServicesResponse\x12;\n" + - "\bservices\x18\x01 \x03(\v2\x1f.management.v1.UniversalServiceR\bservices2\xa2\x13\n" + + "\bservices\x18\x01 \x03(\v2\x1f.management.v1.UniversalServiceR\bservices2\xb4\x15\n" + "\x11ManagementService\x12\xac\x01\n" + "\rAddAnnotation\x12#.management.v1.AddAnnotationRequest\x1a$.management.v1.AddAnnotationResponse\"P\x92A(\x12\x11Add an Annotation\x1a\x13Adds an annotation.\x82\xd3\xe4\x93\x02\x1f:\x01*\"\x1a/v1/management/annotations\x12\x9b\x01\n" + "\n" + @@ -929,7 +927,8 @@ const file_management_v1_service_proto_rawDesc = "" + "\x0eUnregisterNode\x12$.management.v1.UnregisterNodeRequest\x1a%.management.v1.UnregisterNodeResponse\"^\x92A5\x12\x11Unregister a Node\x1a Unregisters a Node and pmm-agent\x82\xd3\xe4\x93\x02 *\x1e/v1/management/nodes/{node_id}\x12\x95\x01\n" + "\tListNodes\x12\x1f.management.v1.ListNodesRequest\x1a .management.v1.ListNodesResponse\"E\x92A&\x12\n" + "List Nodes\x1a\x18Lists Nodes with filter.\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/management/nodes\x12\x98\x01\n" + - "\aGetNode\x12\x1d.management.v1.GetNodeRequest\x1a\x1e.management.v1.GetNodeResponse\"N\x92A%\x12\bGet Node\x1a\x19Gets a single Node by ID.\x82\xd3\xe4\x93\x02 \x12\x1e/v1/management/nodes/{node_id}\x12\xb2\x01\n" + + "\aGetNode\x12\x1d.management.v1.GetNodeRequest\x1a\x1e.management.v1.GetNodeResponse\"N\x92A%\x12\bGet Node\x1a\x19Gets a single Node by ID.\x82\xd3\xe4\x93\x02 \x12\x1e/v1/management/nodes/{node_id}\x12\x8f\x02\n" + + "\x16CreateNodeInstallToken\x12,.management.v1.CreateNodeInstallTokenRequest\x1a-.management.v1.CreateNodeInstallTokenResponse\"\x97\x01\x92Ah\x12\x19Create Node Install Token\x1aKCreates a short-lived Grafana service account token for PMM Client install.\x82\xd3\xe4\x93\x02&:\x01*\"!/v1/management/nodes:installToken\x12\xb2\x01\n" + "\n" + "AddService\x12 .management.v1.AddServiceRequest\x1a!.management.v1.AddServiceResponse\"_\x92A:\x12\rAdd a Service\x1a)Adds a service and starts several agents.\x82\xd3\xe4\x93\x02\x1c:\x01*\"\x17/v1/management/services\x12\xb0\x01\n" + "\fListServices\x12\".management.v1.ListServicesRequest\x1a#.management.v1.ListServicesResponse\"W\x92A5\x12\rList Services\x1a$Returns a filtered list of Services.\x82\xd3\xe4\x93\x02\x19\x12\x17/v1/management/services\x12\xaf\x01\n" + @@ -951,61 +950,60 @@ func file_management_v1_service_proto_rawDescGZIP() []byte { return file_management_v1_service_proto_rawDescData } -var ( - file_management_v1_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_management_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) - file_management_v1_service_proto_goTypes = []any{ - (UniversalService_Status)(0), // 0: management.v1.UniversalService.Status - (*AddServiceRequest)(nil), // 1: management.v1.AddServiceRequest - (*AddServiceResponse)(nil), // 2: management.v1.AddServiceResponse - (*RemoveServiceRequest)(nil), // 3: management.v1.RemoveServiceRequest - (*RemoveServiceResponse)(nil), // 4: management.v1.RemoveServiceResponse - (*UniversalService)(nil), // 5: management.v1.UniversalService - (*ListServicesRequest)(nil), // 6: management.v1.ListServicesRequest - (*ListServicesResponse)(nil), // 7: management.v1.ListServicesResponse - nil, // 8: management.v1.UniversalService.CustomLabelsEntry - (*AddMySQLServiceParams)(nil), // 9: management.v1.AddMySQLServiceParams - (*AddMongoDBServiceParams)(nil), // 10: management.v1.AddMongoDBServiceParams - (*AddPostgreSQLServiceParams)(nil), // 11: management.v1.AddPostgreSQLServiceParams - (*AddProxySQLServiceParams)(nil), // 12: management.v1.AddProxySQLServiceParams - (*AddHAProxyServiceParams)(nil), // 13: management.v1.AddHAProxyServiceParams - (*AddExternalServiceParams)(nil), // 14: management.v1.AddExternalServiceParams - (*AddRDSServiceParams)(nil), // 15: management.v1.AddRDSServiceParams - (*AddValkeyServiceParams)(nil), // 16: management.v1.AddValkeyServiceParams - (*MySQLServiceResult)(nil), // 17: management.v1.MySQLServiceResult - (*MongoDBServiceResult)(nil), // 18: management.v1.MongoDBServiceResult - (*PostgreSQLServiceResult)(nil), // 19: management.v1.PostgreSQLServiceResult - (*ProxySQLServiceResult)(nil), // 20: management.v1.ProxySQLServiceResult - (*HAProxyServiceResult)(nil), // 21: management.v1.HAProxyServiceResult - (*ExternalServiceResult)(nil), // 22: management.v1.ExternalServiceResult - (*RDSServiceResult)(nil), // 23: management.v1.RDSServiceResult - (*ValkeyServiceResult)(nil), // 24: management.v1.ValkeyServiceResult - (v1.ServiceType)(0), // 25: inventory.v1.ServiceType - (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp - (*UniversalAgent)(nil), // 27: management.v1.UniversalAgent - (*AddAnnotationRequest)(nil), // 28: management.v1.AddAnnotationRequest - (*ListAgentsRequest)(nil), // 29: management.v1.ListAgentsRequest - (*ListAgentVersionsRequest)(nil), // 30: management.v1.ListAgentVersionsRequest - (*RegisterNodeRequest)(nil), // 31: management.v1.RegisterNodeRequest - (*UnregisterNodeRequest)(nil), // 32: management.v1.UnregisterNodeRequest - (*ListNodesRequest)(nil), // 33: management.v1.ListNodesRequest - (*GetNodeRequest)(nil), // 34: management.v1.GetNodeRequest - (*DiscoverRDSRequest)(nil), // 35: management.v1.DiscoverRDSRequest - (*DiscoverAzureDatabaseRequest)(nil), // 36: management.v1.DiscoverAzureDatabaseRequest - (*AddAzureDatabaseRequest)(nil), // 37: management.v1.AddAzureDatabaseRequest - (*AddAnnotationResponse)(nil), // 38: management.v1.AddAnnotationResponse - (*ListAgentsResponse)(nil), // 39: management.v1.ListAgentsResponse - (*ListAgentVersionsResponse)(nil), // 40: management.v1.ListAgentVersionsResponse - (*RegisterNodeResponse)(nil), // 41: management.v1.RegisterNodeResponse - (*UnregisterNodeResponse)(nil), // 42: management.v1.UnregisterNodeResponse - (*ListNodesResponse)(nil), // 43: management.v1.ListNodesResponse - (*GetNodeResponse)(nil), // 44: management.v1.GetNodeResponse - (*DiscoverRDSResponse)(nil), // 45: management.v1.DiscoverRDSResponse - (*DiscoverAzureDatabaseResponse)(nil), // 46: management.v1.DiscoverAzureDatabaseResponse - (*AddAzureDatabaseResponse)(nil), // 47: management.v1.AddAzureDatabaseResponse - } -) - +var file_management_v1_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_management_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_management_v1_service_proto_goTypes = []any{ + (UniversalService_Status)(0), // 0: management.v1.UniversalService.Status + (*AddServiceRequest)(nil), // 1: management.v1.AddServiceRequest + (*AddServiceResponse)(nil), // 2: management.v1.AddServiceResponse + (*RemoveServiceRequest)(nil), // 3: management.v1.RemoveServiceRequest + (*RemoveServiceResponse)(nil), // 4: management.v1.RemoveServiceResponse + (*UniversalService)(nil), // 5: management.v1.UniversalService + (*ListServicesRequest)(nil), // 6: management.v1.ListServicesRequest + (*ListServicesResponse)(nil), // 7: management.v1.ListServicesResponse + nil, // 8: management.v1.UniversalService.CustomLabelsEntry + (*AddMySQLServiceParams)(nil), // 9: management.v1.AddMySQLServiceParams + (*AddMongoDBServiceParams)(nil), // 10: management.v1.AddMongoDBServiceParams + (*AddPostgreSQLServiceParams)(nil), // 11: management.v1.AddPostgreSQLServiceParams + (*AddProxySQLServiceParams)(nil), // 12: management.v1.AddProxySQLServiceParams + (*AddHAProxyServiceParams)(nil), // 13: management.v1.AddHAProxyServiceParams + (*AddExternalServiceParams)(nil), // 14: management.v1.AddExternalServiceParams + (*AddRDSServiceParams)(nil), // 15: management.v1.AddRDSServiceParams + (*AddValkeyServiceParams)(nil), // 16: management.v1.AddValkeyServiceParams + (*MySQLServiceResult)(nil), // 17: management.v1.MySQLServiceResult + (*MongoDBServiceResult)(nil), // 18: management.v1.MongoDBServiceResult + (*PostgreSQLServiceResult)(nil), // 19: management.v1.PostgreSQLServiceResult + (*ProxySQLServiceResult)(nil), // 20: management.v1.ProxySQLServiceResult + (*HAProxyServiceResult)(nil), // 21: management.v1.HAProxyServiceResult + (*ExternalServiceResult)(nil), // 22: management.v1.ExternalServiceResult + (*RDSServiceResult)(nil), // 23: management.v1.RDSServiceResult + (*ValkeyServiceResult)(nil), // 24: management.v1.ValkeyServiceResult + (v1.ServiceType)(0), // 25: inventory.v1.ServiceType + (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp + (*UniversalAgent)(nil), // 27: management.v1.UniversalAgent + (*AddAnnotationRequest)(nil), // 28: management.v1.AddAnnotationRequest + (*ListAgentsRequest)(nil), // 29: management.v1.ListAgentsRequest + (*ListAgentVersionsRequest)(nil), // 30: management.v1.ListAgentVersionsRequest + (*RegisterNodeRequest)(nil), // 31: management.v1.RegisterNodeRequest + (*UnregisterNodeRequest)(nil), // 32: management.v1.UnregisterNodeRequest + (*ListNodesRequest)(nil), // 33: management.v1.ListNodesRequest + (*GetNodeRequest)(nil), // 34: management.v1.GetNodeRequest + (*CreateNodeInstallTokenRequest)(nil), // 35: management.v1.CreateNodeInstallTokenRequest + (*DiscoverRDSRequest)(nil), // 36: management.v1.DiscoverRDSRequest + (*DiscoverAzureDatabaseRequest)(nil), // 37: management.v1.DiscoverAzureDatabaseRequest + (*AddAzureDatabaseRequest)(nil), // 38: management.v1.AddAzureDatabaseRequest + (*AddAnnotationResponse)(nil), // 39: management.v1.AddAnnotationResponse + (*ListAgentsResponse)(nil), // 40: management.v1.ListAgentsResponse + (*ListAgentVersionsResponse)(nil), // 41: management.v1.ListAgentVersionsResponse + (*RegisterNodeResponse)(nil), // 42: management.v1.RegisterNodeResponse + (*UnregisterNodeResponse)(nil), // 43: management.v1.UnregisterNodeResponse + (*ListNodesResponse)(nil), // 44: management.v1.ListNodesResponse + (*GetNodeResponse)(nil), // 45: management.v1.GetNodeResponse + (*CreateNodeInstallTokenResponse)(nil), // 46: management.v1.CreateNodeInstallTokenResponse + (*DiscoverRDSResponse)(nil), // 47: management.v1.DiscoverRDSResponse + (*DiscoverAzureDatabaseResponse)(nil), // 48: management.v1.DiscoverAzureDatabaseResponse + (*AddAzureDatabaseResponse)(nil), // 49: management.v1.AddAzureDatabaseResponse +} var file_management_v1_service_proto_depIdxs = []int32{ 9, // 0: management.v1.AddServiceRequest.mysql:type_name -> management.v1.AddMySQLServiceParams 10, // 1: management.v1.AddServiceRequest.mongodb:type_name -> management.v1.AddMongoDBServiceParams @@ -1038,27 +1036,29 @@ var file_management_v1_service_proto_depIdxs = []int32{ 32, // 28: management.v1.ManagementService.UnregisterNode:input_type -> management.v1.UnregisterNodeRequest 33, // 29: management.v1.ManagementService.ListNodes:input_type -> management.v1.ListNodesRequest 34, // 30: management.v1.ManagementService.GetNode:input_type -> management.v1.GetNodeRequest - 1, // 31: management.v1.ManagementService.AddService:input_type -> management.v1.AddServiceRequest - 6, // 32: management.v1.ManagementService.ListServices:input_type -> management.v1.ListServicesRequest - 35, // 33: management.v1.ManagementService.DiscoverRDS:input_type -> management.v1.DiscoverRDSRequest - 36, // 34: management.v1.ManagementService.DiscoverAzureDatabase:input_type -> management.v1.DiscoverAzureDatabaseRequest - 37, // 35: management.v1.ManagementService.AddAzureDatabase:input_type -> management.v1.AddAzureDatabaseRequest - 3, // 36: management.v1.ManagementService.RemoveService:input_type -> management.v1.RemoveServiceRequest - 38, // 37: management.v1.ManagementService.AddAnnotation:output_type -> management.v1.AddAnnotationResponse - 39, // 38: management.v1.ManagementService.ListAgents:output_type -> management.v1.ListAgentsResponse - 40, // 39: management.v1.ManagementService.ListAgentVersions:output_type -> management.v1.ListAgentVersionsResponse - 41, // 40: management.v1.ManagementService.RegisterNode:output_type -> management.v1.RegisterNodeResponse - 42, // 41: management.v1.ManagementService.UnregisterNode:output_type -> management.v1.UnregisterNodeResponse - 43, // 42: management.v1.ManagementService.ListNodes:output_type -> management.v1.ListNodesResponse - 44, // 43: management.v1.ManagementService.GetNode:output_type -> management.v1.GetNodeResponse - 2, // 44: management.v1.ManagementService.AddService:output_type -> management.v1.AddServiceResponse - 7, // 45: management.v1.ManagementService.ListServices:output_type -> management.v1.ListServicesResponse - 45, // 46: management.v1.ManagementService.DiscoverRDS:output_type -> management.v1.DiscoverRDSResponse - 46, // 47: management.v1.ManagementService.DiscoverAzureDatabase:output_type -> management.v1.DiscoverAzureDatabaseResponse - 47, // 48: management.v1.ManagementService.AddAzureDatabase:output_type -> management.v1.AddAzureDatabaseResponse - 4, // 49: management.v1.ManagementService.RemoveService:output_type -> management.v1.RemoveServiceResponse - 37, // [37:50] is the sub-list for method output_type - 24, // [24:37] is the sub-list for method input_type + 35, // 31: management.v1.ManagementService.CreateNodeInstallToken:input_type -> management.v1.CreateNodeInstallTokenRequest + 1, // 32: management.v1.ManagementService.AddService:input_type -> management.v1.AddServiceRequest + 6, // 33: management.v1.ManagementService.ListServices:input_type -> management.v1.ListServicesRequest + 36, // 34: management.v1.ManagementService.DiscoverRDS:input_type -> management.v1.DiscoverRDSRequest + 37, // 35: management.v1.ManagementService.DiscoverAzureDatabase:input_type -> management.v1.DiscoverAzureDatabaseRequest + 38, // 36: management.v1.ManagementService.AddAzureDatabase:input_type -> management.v1.AddAzureDatabaseRequest + 3, // 37: management.v1.ManagementService.RemoveService:input_type -> management.v1.RemoveServiceRequest + 39, // 38: management.v1.ManagementService.AddAnnotation:output_type -> management.v1.AddAnnotationResponse + 40, // 39: management.v1.ManagementService.ListAgents:output_type -> management.v1.ListAgentsResponse + 41, // 40: management.v1.ManagementService.ListAgentVersions:output_type -> management.v1.ListAgentVersionsResponse + 42, // 41: management.v1.ManagementService.RegisterNode:output_type -> management.v1.RegisterNodeResponse + 43, // 42: management.v1.ManagementService.UnregisterNode:output_type -> management.v1.UnregisterNodeResponse + 44, // 43: management.v1.ManagementService.ListNodes:output_type -> management.v1.ListNodesResponse + 45, // 44: management.v1.ManagementService.GetNode:output_type -> management.v1.GetNodeResponse + 46, // 45: management.v1.ManagementService.CreateNodeInstallToken:output_type -> management.v1.CreateNodeInstallTokenResponse + 2, // 46: management.v1.ManagementService.AddService:output_type -> management.v1.AddServiceResponse + 7, // 47: management.v1.ManagementService.ListServices:output_type -> management.v1.ListServicesResponse + 47, // 48: management.v1.ManagementService.DiscoverRDS:output_type -> management.v1.DiscoverRDSResponse + 48, // 49: management.v1.ManagementService.DiscoverAzureDatabase:output_type -> management.v1.DiscoverAzureDatabaseResponse + 49, // 50: management.v1.ManagementService.AddAzureDatabase:output_type -> management.v1.AddAzureDatabaseResponse + 4, // 51: management.v1.ManagementService.RemoveService:output_type -> management.v1.RemoveServiceResponse + 38, // [38:52] is the sub-list for method output_type + 24, // [24:38] is the sub-list for method input_type 24, // [24:24] is the sub-list for extension type_name 24, // [24:24] is the sub-list for extension extendee 0, // [0:24] is the sub-list for field type_name diff --git a/api/management/v1/service.pb.gw.go b/api/management/v1/service.pb.gw.go index 18c78ee4db1..44393ff2ca1 100644 --- a/api/management/v1/service.pb.gw.go +++ b/api/management/v1/service.pb.gw.go @@ -272,6 +272,33 @@ func local_request_ManagementService_GetNode_0(ctx context.Context, marshaler ru return msg, metadata, err } +func request_ManagementService_CreateNodeInstallToken_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq CreateNodeInstallTokenRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } + msg, err := client.CreateNodeInstallToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_ManagementService_CreateNodeInstallToken_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq CreateNodeInstallTokenRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.CreateNodeInstallToken(ctx, &protoReq) + return msg, metadata, err +} + func request_ManagementService_AddService_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var ( protoReq AddServiceRequest @@ -614,6 +641,26 @@ func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.Se } forward_ManagementService_GetNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_ManagementService_CreateNodeInstallToken_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) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/management.v1.ManagementService/CreateNodeInstallToken", runtime.WithHTTPPathPattern("/v1/management/nodes:installToken")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ManagementService_CreateNodeInstallToken_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_ManagementService_CreateNodeInstallToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle(http.MethodPost, pattern_ManagementService_AddService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -893,6 +940,23 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se } forward_ManagementService_GetNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_ManagementService_CreateNodeInstallToken_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) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.v1.ManagementService/CreateNodeInstallToken", runtime.WithHTTPPathPattern("/v1/management/nodes:installToken")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ManagementService_CreateNodeInstallToken_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_ManagementService_CreateNodeInstallToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle(http.MethodPost, pattern_ManagementService_AddService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -999,33 +1063,35 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se } var ( - pattern_ManagementService_AddAnnotation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "annotations"}, "")) - pattern_ManagementService_ListAgents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "agents"}, "")) - pattern_ManagementService_ListAgentVersions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "agents", "versions"}, "")) - pattern_ManagementService_RegisterNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "nodes"}, "")) - pattern_ManagementService_UnregisterNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "management", "nodes", "node_id"}, "")) - pattern_ManagementService_ListNodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "nodes"}, "")) - pattern_ManagementService_GetNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "management", "nodes", "node_id"}, "")) - pattern_ManagementService_AddService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "")) - pattern_ManagementService_ListServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "")) - pattern_ManagementService_DiscoverRDS_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "discoverRDS")) - pattern_ManagementService_DiscoverAzureDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "discoverAzure")) - pattern_ManagementService_AddAzureDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "services", "azure"}, "")) - pattern_ManagementService_RemoveService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "management", "services", "service_id"}, "")) + pattern_ManagementService_AddAnnotation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "annotations"}, "")) + pattern_ManagementService_ListAgents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "agents"}, "")) + pattern_ManagementService_ListAgentVersions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "agents", "versions"}, "")) + pattern_ManagementService_RegisterNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "nodes"}, "")) + pattern_ManagementService_UnregisterNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "management", "nodes", "node_id"}, "")) + pattern_ManagementService_ListNodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "nodes"}, "")) + pattern_ManagementService_GetNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "management", "nodes", "node_id"}, "")) + pattern_ManagementService_CreateNodeInstallToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "nodes"}, "installToken")) + pattern_ManagementService_AddService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "")) + pattern_ManagementService_ListServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "")) + pattern_ManagementService_DiscoverRDS_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "discoverRDS")) + pattern_ManagementService_DiscoverAzureDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "discoverAzure")) + pattern_ManagementService_AddAzureDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "services", "azure"}, "")) + pattern_ManagementService_RemoveService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "management", "services", "service_id"}, "")) ) var ( - forward_ManagementService_AddAnnotation_0 = runtime.ForwardResponseMessage - forward_ManagementService_ListAgents_0 = runtime.ForwardResponseMessage - forward_ManagementService_ListAgentVersions_0 = runtime.ForwardResponseMessage - forward_ManagementService_RegisterNode_0 = runtime.ForwardResponseMessage - forward_ManagementService_UnregisterNode_0 = runtime.ForwardResponseMessage - forward_ManagementService_ListNodes_0 = runtime.ForwardResponseMessage - forward_ManagementService_GetNode_0 = runtime.ForwardResponseMessage - forward_ManagementService_AddService_0 = runtime.ForwardResponseMessage - forward_ManagementService_ListServices_0 = runtime.ForwardResponseMessage - forward_ManagementService_DiscoverRDS_0 = runtime.ForwardResponseMessage - forward_ManagementService_DiscoverAzureDatabase_0 = runtime.ForwardResponseMessage - forward_ManagementService_AddAzureDatabase_0 = runtime.ForwardResponseMessage - forward_ManagementService_RemoveService_0 = runtime.ForwardResponseMessage + forward_ManagementService_AddAnnotation_0 = runtime.ForwardResponseMessage + forward_ManagementService_ListAgents_0 = runtime.ForwardResponseMessage + forward_ManagementService_ListAgentVersions_0 = runtime.ForwardResponseMessage + forward_ManagementService_RegisterNode_0 = runtime.ForwardResponseMessage + forward_ManagementService_UnregisterNode_0 = runtime.ForwardResponseMessage + forward_ManagementService_ListNodes_0 = runtime.ForwardResponseMessage + forward_ManagementService_GetNode_0 = runtime.ForwardResponseMessage + forward_ManagementService_CreateNodeInstallToken_0 = runtime.ForwardResponseMessage + forward_ManagementService_AddService_0 = runtime.ForwardResponseMessage + forward_ManagementService_ListServices_0 = runtime.ForwardResponseMessage + forward_ManagementService_DiscoverRDS_0 = runtime.ForwardResponseMessage + forward_ManagementService_DiscoverAzureDatabase_0 = runtime.ForwardResponseMessage + forward_ManagementService_AddAzureDatabase_0 = runtime.ForwardResponseMessage + forward_ManagementService_RemoveService_0 = runtime.ForwardResponseMessage ) diff --git a/api/management/v1/service.proto b/api/management/v1/service.proto index afdcfacd5c2..f13f1d7e57a 100644 --- a/api/management/v1/service.proto +++ b/api/management/v1/service.proto @@ -188,6 +188,17 @@ service ManagementService { description: "Gets a single Node by ID." }; } + // CreateNodeInstallToken mints a short-lived Grafana token for PMM Client installation scripts (no inventory rows). + rpc CreateNodeInstallToken(CreateNodeInstallTokenRequest) returns (CreateNodeInstallTokenResponse) { + option (google.api.http) = { + post: "/v1/management/nodes:installToken" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Create Node Install Token" + description: "Creates a short-lived Grafana service account token for PMM Client install." + }; + } // MySQL: adds MySQL Service and starts several Agents. // It automatically adds a service to inventory, which is running on provided "node_id", // then adds "mysqld_exporter", and "qan_mysql_perfschema" agents diff --git a/api/management/v1/service.swagger.json b/api/management/v1/service.swagger.json new file mode 100644 index 00000000000..8e3860812b9 --- /dev/null +++ b/api/management/v1/service.swagger.json @@ -0,0 +1,4565 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/service.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "ManagementService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/management/agents": { + "get": { + "summary": "List Agents", + "description": "Lists Agents with filter.", + "operationId": "ListAgents", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListAgentsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "service_id", + "description": "Return only Agents that relate to a specific ServiceID.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "node_id", + "description": "Return only Agents that relate to a specific NodeID.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "ManagementService" + ] + } + }, + "/v1/management/agents/versions": { + "get": { + "summary": "List Agent Versions", + "description": "Lists Agent versions and their update severity.", + "operationId": "ListAgentVersions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListAgentVersionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "tags": [ + "ManagementService" + ] + } + }, + "/v1/management/annotations": { + "post": { + "summary": "Add an Annotation", + "description": "Adds an annotation.", + "operationId": "AddAnnotation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1AddAnnotationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "AddAnnotationRequest is a params to add new annotation.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1AddAnnotationRequest" + } + } + ], + "tags": [ + "ManagementService" + ] + } + }, + "/v1/management/nodes": { + "get": { + "summary": "List Nodes", + "description": "Lists Nodes with filter.", + "operationId": "ListNodes", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListNodesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "node_type", + "description": "Node type to be filtered out.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ], + "default": "NODE_TYPE_UNSPECIFIED" + } + ], + "tags": [ + "ManagementService" + ] + }, + "post": { + "summary": "Register a Node", + "description": "Registers a new Node and a pmm-agent.", + "operationId": "RegisterNode", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RegisterNodeResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1RegisterNodeRequest" + } + } + ], + "tags": [ + "ManagementService" + ] + } + }, + "/v1/management/nodes/{node_id}": { + "get": { + "summary": "Get Node", + "description": "Gets a single Node by ID.", + "operationId": "GetNode", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetNodeResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "node_id", + "description": "Unique Node identifier.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "ManagementService" + ] + }, + "delete": { + "summary": "Unregister a Node", + "description": "Unregisters a Node and pmm-agent", + "operationId": "UnregisterNode", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnregisterNodeResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "node_id", + "description": "Node_id to be unregistered.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "force", + "description": "Force delete node, related service account, even if it has more service tokens attached.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "ManagementService" + ] + } + }, + "/v1/management/nodes:installToken": { + "post": { + "summary": "Create Node Install Token", + "description": "Creates a short-lived Grafana service account token for PMM Client install.", + "operationId": "CreateNodeInstallToken", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateNodeInstallTokenResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateNodeInstallTokenRequest" + } + } + ], + "tags": [ + "ManagementService" + ] + } + }, + "/v1/management/services": { + "get": { + "summary": "List Services", + "description": "Returns a filtered list of Services.", + "operationId": "ListServices", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListServicesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "node_id", + "description": "Return only Services running on that Node.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "service_type", + "description": "Return only services filtered by service type.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "SERVICE_TYPE_UNSPECIFIED", + "SERVICE_TYPE_MYSQL_SERVICE", + "SERVICE_TYPE_MONGODB_SERVICE", + "SERVICE_TYPE_POSTGRESQL_SERVICE", + "SERVICE_TYPE_VALKEY_SERVICE", + "SERVICE_TYPE_PROXYSQL_SERVICE", + "SERVICE_TYPE_HAPROXY_SERVICE", + "SERVICE_TYPE_EXTERNAL_SERVICE" + ], + "default": "SERVICE_TYPE_UNSPECIFIED" + }, + { + "name": "external_group", + "description": "Return only services in this external group.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "ManagementService" + ] + }, + "post": { + "summary": "Add a Service", + "description": "Adds a service and starts several agents.", + "operationId": "AddService", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1AddServiceResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1AddServiceRequest" + } + } + ], + "tags": [ + "ManagementService" + ] + } + }, + "/v1/management/services/azure": { + "post": { + "summary": "Add Azure Database", + "description": "Adds an Azure Database instance.", + "operationId": "AddAzureDatabase", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1AddAzureDatabaseResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1AddAzureDatabaseRequest" + } + } + ], + "tags": [ + "ManagementService" + ] + } + }, + "/v1/management/services/{service_id}": { + "delete": { + "summary": "Remove a Service", + "description": "Removes a Service along with its Agents.", + "operationId": "RemoveService", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RemoveServiceResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "service_id", + "description": "Either a Service ID or a Service Name.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "service_type", + "description": "Service type.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "SERVICE_TYPE_UNSPECIFIED", + "SERVICE_TYPE_MYSQL_SERVICE", + "SERVICE_TYPE_MONGODB_SERVICE", + "SERVICE_TYPE_POSTGRESQL_SERVICE", + "SERVICE_TYPE_VALKEY_SERVICE", + "SERVICE_TYPE_PROXYSQL_SERVICE", + "SERVICE_TYPE_HAPROXY_SERVICE", + "SERVICE_TYPE_EXTERNAL_SERVICE" + ], + "default": "SERVICE_TYPE_UNSPECIFIED" + } + ], + "tags": [ + "ManagementService" + ] + } + }, + "/v1/management/services:discoverAzure": { + "post": { + "summary": "Discover Azure Database", + "description": "Discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances.", + "operationId": "DiscoverAzureDatabase", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DiscoverAzureDatabaseResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "DiscoverAzureDatabaseRequest discover azure databases request.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DiscoverAzureDatabaseRequest" + } + } + ], + "tags": [ + "ManagementService" + ] + } + }, + "/v1/management/services:discoverRDS": { + "post": { + "summary": "Discover RDS", + "description": "Discovers RDS instances.", + "operationId": "DiscoverRDS", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DiscoverRDSResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googleRpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DiscoverRDSRequest" + } + } + ], + "tags": [ + "ManagementService" + ] + } + } + }, + "definitions": { + "UniversalAgentAzureOptions": { + "type": "object", + "properties": { + "client_id": { + "type": "string", + "description": "Azure client ID." + }, + "is_client_secret_set": { + "type": "boolean", + "description": "True if Azure client secret is set." + }, + "resource_group": { + "type": "string", + "description": "Azure resource group." + }, + "subscription_id": { + "type": "string", + "description": "Azure subscription ID." + }, + "tenant_id": { + "type": "string", + "description": "Azure tenant ID." + } + } + }, + "UniversalAgentMongoDBOptions": { + "type": "object", + "properties": { + "is_tls_certificate_key_set": { + "type": "boolean", + "description": "True if TLS certificate is set." + }, + "is_tls_certificate_key_file_password_set": { + "type": "boolean", + "description": "True if TLS certificate file password is set." + }, + "authentication_mechanism": { + "type": "string", + "description": "MongoDB auth mechanism." + }, + "authentication_database": { + "type": "string", + "description": "MongoDB auth database." + }, + "stats_collections": { + "type": "array", + "items": { + "type": "string" + }, + "description": "MongoDB stats collections." + }, + "collections_limit": { + "type": "integer", + "format": "int32", + "description": "MongoDB collections limit." + }, + "enable_all_collectors": { + "type": "boolean", + "description": "True if all collectors are enabled." + } + } + }, + "UniversalAgentMySQLOptions": { + "type": "object", + "properties": { + "is_tls_key_set": { + "type": "boolean", + "description": "True if TLS key is set." + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra DSN parameters for MySQL connection." + } + } + }, + "UniversalAgentPostgreSQLOptions": { + "type": "object", + "properties": { + "is_ssl_key_set": { + "type": "boolean", + "description": "True if TLS key is set." + }, + "auto_discovery_limit": { + "type": "integer", + "format": "int32", + "description": "Limit of databases for auto-discovery." + }, + "max_exporter_connections": { + "type": "integer", + "format": "int32", + "description": "Maximum number of connections from exporter to PostgreSQL instance." + } + } + }, + "UniversalAgentValkeyOptions": { + "type": "object" + }, + "UniversalNodeAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique Agent identifier." + }, + "agent_type": { + "type": "string", + "description": "Agent type." + }, + "status": { + "type": "string", + "description": "Actual Agent status." + }, + "is_connected": { + "type": "boolean", + "description": "True if Agent is running and connected to pmm-managed." + } + } + }, + "UniversalNodeService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique Service identifier." + }, + "service_type": { + "type": "string", + "description": "Service type." + }, + "service_name": { + "type": "string", + "description": "Service name." + } + }, + "description": "Service represents a service running on a node." + }, + "commonMetricsResolutions": { + "type": "object", + "properties": { + "hr": { + "type": "string", + "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix." + }, + "mr": { + "type": "string", + "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix." + }, + "lr": { + "type": "string", + "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix." + } + }, + "description": "MetricsResolutions represents Prometheus exporters metrics resolutions." + }, + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "v1AddAnnotationRequest": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "An annotation description. Required." + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags are used to filter annotations." + }, + "node_name": { + "type": "string", + "description": "Used for annotating a node." + }, + "service_names": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Used for annotating services." + } + }, + "description": "AddAnnotationRequest is a params to add new annotation." + }, + "v1AddAnnotationResponse": { + "type": "object" + }, + "v1AddAzureDatabaseRequest": { + "type": "object", + "properties": { + "region": { + "type": "string", + "description": "Azure database location." + }, + "az": { + "type": "string", + "description": "Azure database availability zone." + }, + "instance_id": { + "type": "string", + "description": "Azure database instance ID." + }, + "node_model": { + "type": "string", + "description": "Represents a purchasable Stock Keeping Unit (SKU) under a product.\nhttps://docs.microsoft.com/en-us/partner-center/develop/product-resources#sku." + }, + "address": { + "type": "string", + "description": "Address used to connect to it." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port." + }, + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name. Defaults to Azure Database instance ID." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Defaults to Azure Database instance ID." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "username": { + "type": "string", + "description": "Username for scraping metrics." + }, + "password": { + "type": "string", + "description": "Password for scraping metrics." + }, + "azure_client_id": { + "type": "string", + "description": "Azure client ID." + }, + "azure_client_secret": { + "type": "string", + "description": "Azure client secret." + }, + "azure_tenant_id": { + "type": "string", + "description": "Azure tanant ID." + }, + "azure_subscription_id": { + "type": "string", + "description": "Azure subscription ID." + }, + "azure_resource_group": { + "type": "string", + "description": "Azure resource group." + }, + "azure_database_exporter": { + "type": "boolean", + "description": "If true, adds azure_database_exporter." + }, + "qan": { + "type": "boolean", + "description": "If true, adds qan-mysql-perfschema-agent or qan-postgresql-pgstatements-agent." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels for Node and Service." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "disable_query_examples": { + "type": "boolean", + "description": "Disable query examples." + }, + "tablestats_group_table_limit": { + "type": "integer", + "format": "int32", + "description": "Tablestats group collectors will be disabled if there are more than that number of tables.\nIf zero, server's default value is used.\nUse negative value to disable them." + }, + "type": { + "$ref": "#/definitions/v1DiscoverAzureDatabaseType", + "title": "Azure database resource type (mysql, maria, postgres)" + } + } + }, + "v1AddAzureDatabaseResponse": { + "type": "object" + }, + "v1AddExternalServiceParams": { + "type": "object", + "properties": { + "runs_on_node_id": { + "type": "string", + "description": "Node identifier on which an external exporter is been running.\nruns_on_node_id should always be passed with node_id.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "node_name": { + "type": "string", + "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "add_node": { + "$ref": "#/definitions/v1AddNodeParams", + "description": "Create a new Node with those parameters.\nadd_node should always be passed with address.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "address": { + "type": "string", + "description": "Node and Exporter access address (DNS name or IP).\naddress should always be passed with add_node." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Required." + }, + "username": { + "type": "string", + "description": "HTTP basic auth username for collecting metrics." + }, + "password": { + "type": "string", + "description": "HTTP basic auth password for collecting metrics." + }, + "scheme": { + "type": "string", + "description": "Scheme to generate URI to exporter metrics endpoints." + }, + "metrics_path": { + "type": "string", + "description": "Path under which metrics are exposed, used to generate URI." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "node_id": { + "type": "string", + "description": "Node identifier on which an external service is been running.\nnode_id should always be passed with runs_on_node_id." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels for Service." + }, + "group": { + "type": "string", + "description": "Group name of external service." + }, + "metrics_mode": { + "$ref": "#/definitions/v1MetricsMode", + "description": "Defines metrics flow model for this exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically.\nNode with registered pmm_agent_id must present at pmm-server\nin case of push metrics_mode." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + } + } + }, + "v1AddHAProxyServiceParams": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Node identifier on which an external exporter is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "node_name": { + "type": "string", + "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "add_node": { + "$ref": "#/definitions/v1AddNodeParams", + "description": "Create a new Node with those parameters.\nadd_node always should be passed with address.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "address": { + "type": "string", + "description": "Node and Exporter access address (DNS name or IP).\naddress always should be passed with add_node." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Required." + }, + "username": { + "type": "string", + "description": "HTTP basic auth username for collecting metrics." + }, + "password": { + "type": "string", + "description": "HTTP basic auth password for collecting metrics." + }, + "scheme": { + "type": "string", + "description": "Scheme to generate URI to exporter metrics endpoints." + }, + "metrics_path": { + "type": "string", + "description": "Path under which metrics are exposed, used to generate URI." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels for Service." + }, + "metrics_mode": { + "$ref": "#/definitions/v1MetricsMode", + "description": "Defines metrics flow model for this exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically.\nNode with registered pmm_agent_id must present at pmm-server\nin case of push metrics_mode." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + } + } + }, + "v1AddMongoDBServiceParams": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "node_name": { + "type": "string", + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "add_node": { + "$ref": "#/definitions/v1AddNodeParams", + "description": "Create a new Node with those parameters.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Required." + }, + "address": { + "type": "string", + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Service Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Service Access socket.\nAddress (and port) or socket is required." + }, + "pmm_agent_id": { + "type": "string", + "description": "The \"pmm-agent\" identifier which should run agents. Required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "username": { + "type": "string", + "description": "MongoDB username for exporter and QAN agent access." + }, + "password": { + "type": "string", + "description": "MongoDB password for exporter and QAN agent access." + }, + "qan_mongodb_profiler": { + "type": "boolean", + "description": "If true, adds qan-mongodb-profiler-agent for provided service." + }, + "qan_mongodb_mongolog": { + "type": "boolean", + "description": "If true, adds qan-mongodb-mongolog-agent for provided service." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels for Service." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_certificate_key": { + "type": "string", + "description": "Client certificate and key." + }, + "tls_certificate_key_file_password": { + "type": "string", + "description": "Password for decrypting tls_certificate_key." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "metrics_mode": { + "$ref": "#/definitions/v1MetricsMode", + "description": "Defines metrics flow model for this exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "authentication_mechanism": { + "type": "string", + "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details." + }, + "authentication_database": { + "type": "string", + "description": "Authentication database." + }, + "agent_password": { + "type": "string", + "description": "Custom password for exporter endpoint /metrics." + }, + "stats_collections": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collections to get stats from. Can use * ." + }, + "collections_limit": { + "type": "integer", + "format": "int32", + "title": "Collections limit. Only get Databases and collection stats if the total number of collections in the server\nis less than this value. 0: no limit" + }, + "enable_all_collectors": { + "type": "boolean", + "title": "Enable all collectors" + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "title": "Exporter log level" + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "environment_variable_names": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Environment variable names to pass to the exporter.\nValues will be resolved from pmm-agent's environment when starting the exporter." + }, + "rta_mongodb_agent": { + "type": "boolean", + "description": "If true, adds Real-Time Analytics agent for the provided service." + } + } + }, + "v1AddMySQLServiceParams": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "node_name": { + "type": "string", + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "add_node": { + "$ref": "#/definitions/v1AddNodeParams", + "description": "Create a new Node with those parameters.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Required." + }, + "address": { + "type": "string", + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Service Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Service Access socket.\nAddress (and port) or socket is required." + }, + "pmm_agent_id": { + "type": "string", + "description": "The \"pmm-agent\" identifier which should run agents. Required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "username": { + "type": "string", + "description": "MySQL username for scraping metrics." + }, + "password": { + "type": "string", + "description": "MySQL password for scraping metrics." + }, + "qan_mysql_perfschema": { + "type": "boolean", + "description": "If true, adds qan-mysql-perfschema-agent for provided service." + }, + "qan_mysql_slowlog": { + "type": "boolean", + "description": "If true, adds qan-mysql-slowlog-agent for provided service." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels for Service." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "disable_query_examples": { + "type": "boolean", + "description": "Disable query examples." + }, + "max_slowlog_file_size": { + "type": "string", + "format": "int64", + "description": "If qan-mysql-slowlog-agent is added, slowlog file is rotated at this size if \u003e 0.\nIf zero, server's default value is used.\nUse negative value to disable rotation." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "tls_cert": { + "type": "string", + "description": "Client certificate." + }, + "tls_key": { + "type": "string", + "description": "Password for decrypting tls_cert." + }, + "tablestats_group_table_limit": { + "type": "integer", + "format": "int32", + "description": "Tablestats group collectors will be disabled if there are more than that number of tables.\nIf zero, server's default value is used.\nUse negative value to disable them." + }, + "metrics_mode": { + "$ref": "#/definitions/v1MetricsMode", + "description": "Defines metrics flow model for this exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "agent_password": { + "type": "string", + "description": "Custom password for exporter endpoint /metrics." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "title": "Exporter log level" + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "extra DSN parameters to be used for connecting to MySQL." + } + } + }, + "v1AddNodeParams": { + "type": "object", + "properties": { + "node_type": { + "$ref": "#/definitions/v1NodeType", + "description": "Node type to be registered." + }, + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "machine_id": { + "type": "string", + "description": "Linux machine-id." + }, + "distro": { + "type": "string", + "description": "Linux distribution name and version." + }, + "container_id": { + "type": "string", + "description": "Container identifier. If specified, must be a unique Docker container identifier." + }, + "container_name": { + "type": "string", + "description": "Container name." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels for Node." + } + }, + "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service." + }, + "v1AddPostgreSQLServiceParams": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "node_name": { + "type": "string", + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "add_node": { + "$ref": "#/definitions/v1AddNodeParams", + "description": "Create a new Node with those parameters.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Required." + }, + "address": { + "type": "string", + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Service Access port.\nPort is required when the address present." + }, + "database": { + "type": "string", + "description": "Database name." + }, + "socket": { + "type": "string", + "description": "Service Access socket.\nAddress (and port) or socket is required." + }, + "pmm_agent_id": { + "type": "string", + "description": "The \"pmm-agent\" identifier which should run agents. Required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "username": { + "type": "string", + "description": "PostgreSQL username for scraping metrics." + }, + "password": { + "type": "string", + "description": "PostgreSQL password for scraping metrics." + }, + "qan_postgresql_pgstatements_agent": { + "type": "boolean", + "description": "If true, adds qan-postgresql-pgstatements-agent for provided service." + }, + "qan_postgresql_pgstatmonitor_agent": { + "type": "boolean", + "description": "If true, adds qan-postgresql-pgstatmonitor-agent for provided service." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "disable_query_examples": { + "type": "boolean", + "description": "Disable query examples." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels for Service." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full." + }, + "metrics_mode": { + "$ref": "#/definitions/v1MetricsMode", + "description": "Defines metrics flow model for this exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "tls_ca": { + "type": "string", + "description": "TLS CA certificate." + }, + "tls_cert": { + "type": "string", + "description": "TLS Certifcate." + }, + "tls_key": { + "type": "string", + "description": "TLS Certificate Key." + }, + "agent_password": { + "type": "string", + "description": "Custom password for exporter endpoint /metrics." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "title": "Exporter log level" + }, + "auto_discovery_limit": { + "type": "integer", + "format": "int32", + "description": "Limit for auto discovery." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "max_exporter_connections": { + "type": "integer", + "format": "int32", + "description": "Maximum number of connections that exporter can open to the database instance." + } + } + }, + "v1AddProxySQLServiceParams": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "node_name": { + "type": "string", + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "add_node": { + "$ref": "#/definitions/v1AddNodeParams", + "description": "Create a new Node with those parameters.\nExactly one of these parameters should be present: node_id, node_name, add_node." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Required." + }, + "address": { + "type": "string", + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Service Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Service Access socket.\nAddress (and port) or socket is required." + }, + "pmm_agent_id": { + "type": "string", + "description": "The \"pmm-agent\" identifier which should run agents. Required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "username": { + "type": "string", + "description": "ProxySQL username for scraping metrics." + }, + "password": { + "type": "string", + "description": "ProxySQL password for scraping metrics." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels for Service." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "metrics_mode": { + "$ref": "#/definitions/v1MetricsMode", + "description": "Defines metrics flow model for this exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "agent_password": { + "type": "string", + "description": "Custom password for exporter endpoint /metrics." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "title": "Exporter log level" + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + } + } + }, + "v1AddRDSServiceParams": { + "type": "object", + "properties": { + "region": { + "type": "string", + "description": "AWS region." + }, + "az": { + "type": "string", + "description": "AWS availability zone." + }, + "instance_id": { + "type": "string", + "description": "AWS instance ID." + }, + "node_model": { + "type": "string", + "description": "AWS instance class." + }, + "address": { + "type": "string", + "description": "Address used to connect to it." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port." + }, + "engine": { + "$ref": "#/definitions/v1DiscoverRDSEngine", + "description": "Instance engine." + }, + "pmm_agent_id": { + "type": "string", + "description": "PMM Agent ID." + }, + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name. Defaults to AWS instance ID." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name. Defaults to AWS instance ID." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "username": { + "type": "string", + "description": "Username for scraping metrics." + }, + "password": { + "type": "string", + "description": "Password for scraping metrics." + }, + "aws_access_key": { + "type": "string", + "description": "AWS Access key." + }, + "aws_secret_key": { + "type": "string", + "description": "AWS Secret key." + }, + "rds_exporter": { + "type": "boolean", + "description": "If true, adds rds_exporter." + }, + "qan_mysql_perfschema": { + "type": "boolean", + "description": "If true, adds qan-mysql-perfschema-agent." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels for Node and Service." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "disable_query_examples": { + "type": "boolean", + "description": "Disable query examples." + }, + "tablestats_group_table_limit": { + "type": "integer", + "format": "int32", + "description": "Tablestats group collectors will be disabled if there are more than that number of tables.\nIf zero, server's default value is used.\nUse negative value to disable them." + }, + "disable_basic_metrics": { + "type": "boolean", + "description": "Disable basic metrics." + }, + "disable_enhanced_metrics": { + "type": "boolean", + "description": "Disable enhanced metrics." + }, + "metrics_mode": { + "$ref": "#/definitions/v1MetricsMode", + "description": "Defines metrics flow model for this exporter.\nPush metrics mode is not allowed." + }, + "qan_postgresql_pgstatements": { + "type": "boolean", + "title": "If true, add qan-pgstatements" + }, + "agent_password": { + "type": "string", + "description": "Custom password for exporter endpoint /metrics." + }, + "database": { + "type": "string", + "description": "Database name." + }, + "auto_discovery_limit": { + "type": "integer", + "format": "int32", + "description": "Limit of databases for auto-discovery." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "max_postgresql_exporter_connections": { + "type": "integer", + "format": "int32", + "description": "Maximum number of exporter connections to PostgreSQL instance." + } + } + }, + "v1AddServiceRequest": { + "type": "object", + "properties": { + "mysql": { + "$ref": "#/definitions/v1AddMySQLServiceParams" + }, + "mongodb": { + "$ref": "#/definitions/v1AddMongoDBServiceParams" + }, + "postgresql": { + "$ref": "#/definitions/v1AddPostgreSQLServiceParams" + }, + "proxysql": { + "$ref": "#/definitions/v1AddProxySQLServiceParams" + }, + "haproxy": { + "$ref": "#/definitions/v1AddHAProxyServiceParams" + }, + "external": { + "$ref": "#/definitions/v1AddExternalServiceParams" + }, + "rds": { + "$ref": "#/definitions/v1AddRDSServiceParams" + }, + "valkey": { + "$ref": "#/definitions/v1AddValkeyServiceParams" + } + } + }, + "v1AddServiceResponse": { + "type": "object", + "properties": { + "mysql": { + "$ref": "#/definitions/v1MySQLServiceResult" + }, + "mongodb": { + "$ref": "#/definitions/v1MongoDBServiceResult" + }, + "postgresql": { + "$ref": "#/definitions/v1PostgreSQLServiceResult" + }, + "proxysql": { + "$ref": "#/definitions/v1ProxySQLServiceResult" + }, + "haproxy": { + "$ref": "#/definitions/v1HAProxyServiceResult" + }, + "external": { + "$ref": "#/definitions/v1ExternalServiceResult" + }, + "rds": { + "$ref": "#/definitions/v1RDSServiceResult" + }, + "valkey": { + "$ref": "#/definitions/v1ValkeyServiceResult" + } + } + }, + "v1AddValkeyServiceParams": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Node identifier on which the service is running.\nOnly one of these parameters should be present: node_id, node_name, add_node." + }, + "node_name": { + "type": "string", + "description": "Node name on which a service is running.\nOnly one of these parameters should be present: node_id, node_name, add_node." + }, + "add_node": { + "$ref": "#/definitions/v1AddNodeParams", + "description": "Create a new Node with those parameters.\nOnly one of these parameters should be present: node_id, node_name, add_node." + }, + "service_name": { + "type": "string", + "description": "User-defined name, it is required and should be unique across all services." + }, + "address": { + "type": "string", + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Service access port.\nPort is required when the address is present." + }, + "socket": { + "type": "string", + "description": "Service access socket.\nAddress (and port) or socket is required." + }, + "pmm_agent_id": { + "type": "string", + "description": "The \"pmm-agent\" identifier which should run agents. Required." + }, + "username": { + "type": "string", + "description": "Valkey username for scraping metrics." + }, + "password": { + "type": "string", + "description": "Valkey password for scraping metrics." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels for Service." + }, + "skip_connection_check": { + "type": "boolean", + "description": "Skip connection check." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for connection." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS verification." + }, + "metrics_mode": { + "$ref": "#/definitions/v1MetricsMode", + "description": "Defines metrics flow model for the Valkey exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "title": "Exporter log level" + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "tls_ca": { + "type": "string", + "description": "TLS CA certificate." + }, + "tls_cert": { + "type": "string", + "description": "TLS Certifcate." + }, + "tls_key": { + "type": "string", + "description": "TLS Certificate Key." + }, + "agent_password": { + "type": "string", + "description": "Custom password for exporter endpoint /metrics." + } + } + }, + "v1AgentStatus": { + "type": "string", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ], + "default": "AGENT_STATUS_UNSPECIFIED", + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state." + }, + "v1AgentVersions": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Agent ID." + }, + "version": { + "type": "string", + "description": "Agent version." + }, + "node_name": { + "type": "string", + "description": "Node name where the agent runs." + }, + "severity": { + "$ref": "#/definitions/v1UpdateSeverity", + "description": "Update severity." + } + } + }, + "v1ContainerNode": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "address": { + "type": "string", + "description": "Node address (DNS name or IP)." + }, + "machine_id": { + "type": "string", + "description": "Linux machine-id of the Generic Node where this Container Node runs." + }, + "container_id": { + "type": "string", + "description": "Container identifier. If specified, must be a unique Docker container identifier." + }, + "container_name": { + "type": "string", + "description": "Container name." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "is_pmm_server_node": { + "type": "boolean", + "description": "True if this node is a PMM Server node (HA mode)." + } + }, + "description": "ContainerNode represents a Docker container." + }, + "v1CreateNodeInstallTokenRequest": { + "type": "object", + "properties": { + "ttl_seconds": { + "type": "integer", + "format": "int64", + "description": "Token TTL in seconds; 0 means use server default. Server clamps to a maximum." + }, + "technology": { + "type": "string", + "description": "Technology for install script TECH env (e.g. mysql, postgresql, mongodb)." + } + }, + "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash)." + }, + "v1CreateNodeInstallTokenResponse": { + "type": "object", + "properties": { + "token": { + "type": "string", + "description": "Plaintext token for PMM_SERVER_URL userinfo (service_token:\u003ctoken\u003e)." + }, + "expires_at": { + "type": "string", + "format": "date-time", + "description": "Expiration time of the token (derived from TTL)." + }, + "service_account_id": { + "type": "string", + "format": "int64", + "description": "Grafana service account id created for this install token flow." + } + }, + "description": "CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL." + }, + "v1DiscoverAzureDatabaseInstance": { + "type": "object", + "properties": { + "instance_id": { + "type": "string", + "description": "Azure database instance ID." + }, + "region": { + "type": "string", + "description": "Azure database location." + }, + "service_name": { + "type": "string", + "description": "Azure database server name." + }, + "username": { + "type": "string", + "description": "Database username." + }, + "address": { + "type": "string", + "description": "Address used to connect to it." + }, + "azure_resource_group": { + "type": "string", + "description": "Azure Resource group." + }, + "environment": { + "type": "string", + "description": "Environment tag." + }, + "type": { + "$ref": "#/definitions/v1DiscoverAzureDatabaseType", + "description": "Database type." + }, + "az": { + "type": "string", + "description": "Azure database availability zone." + }, + "node_model": { + "type": "string", + "description": "Represents a purchasable Stock Keeping Unit (SKU) under a product.\nhttps://docs.microsoft.com/en-us/partner-center/develop/product-resources#sku." + } + }, + "description": "DiscoverAzureDatabaseInstance models an unique Azure Database instance for the list of instances returned by Discovery." + }, + "v1DiscoverAzureDatabaseRequest": { + "type": "object", + "properties": { + "azure_client_id": { + "type": "string", + "description": "Azure client ID." + }, + "azure_client_secret": { + "type": "string", + "description": "Azure client secret." + }, + "azure_tenant_id": { + "type": "string", + "description": "Azure tanant ID." + }, + "azure_subscription_id": { + "type": "string", + "description": "Azure subscription ID." + } + }, + "description": "DiscoverAzureDatabaseRequest discover azure databases request." + }, + "v1DiscoverAzureDatabaseResponse": { + "type": "object", + "properties": { + "azure_database_instance": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1DiscoverAzureDatabaseInstance" + } + } + }, + "description": "DiscoverAzureDatabaseResponse discover azure databases response." + }, + "v1DiscoverAzureDatabaseType": { + "type": "string", + "enum": [ + "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", + "DISCOVER_AZURE_DATABASE_TYPE_MYSQL", + "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" + ], + "default": "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", + "description": "DiscoverAzureDatabaseType describes supported Azure Database instance engines.\n\n - DISCOVER_AZURE_DATABASE_TYPE_MYSQL: MySQL type: microsoft.dbformysql or MariaDB type: microsoft.dbformariadb\n - DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL: PostgreSQL type: microsoft.dbformysql" + }, + "v1DiscoverRDSEngine": { + "type": "string", + "enum": [ + "DISCOVER_RDS_ENGINE_UNSPECIFIED", + "DISCOVER_RDS_ENGINE_MYSQL", + "DISCOVER_RDS_ENGINE_POSTGRESQL" + ], + "default": "DISCOVER_RDS_ENGINE_UNSPECIFIED", + "description": "DiscoverRDSEngine describes supported RDS instance engines." + }, + "v1DiscoverRDSInstance": { + "type": "object", + "properties": { + "region": { + "type": "string", + "description": "AWS region." + }, + "az": { + "type": "string", + "description": "AWS availability zone." + }, + "instance_id": { + "type": "string", + "description": "AWS instance ID." + }, + "node_model": { + "type": "string", + "description": "AWS instance class." + }, + "address": { + "type": "string", + "description": "Address used to connect to it." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port." + }, + "engine": { + "$ref": "#/definitions/v1DiscoverRDSEngine", + "description": "Instance engine." + }, + "engine_version": { + "type": "string", + "description": "Engine version." + } + }, + "description": "DiscoverRDSInstance models an unique RDS instance for the list of instances returned by Discovery." + }, + "v1DiscoverRDSRequest": { + "type": "object", + "properties": { + "aws_access_key": { + "type": "string", + "description": "AWS Access key. Optional." + }, + "aws_secret_key": { + "type": "string", + "description": "AWS Secret key. Optional." + } + } + }, + "v1DiscoverRDSResponse": { + "type": "object", + "properties": { + "rds_instances": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1DiscoverRDSInstance" + } + } + } + }, + "v1ExternalExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "runs_on_node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "disabled": { + "type": "boolean", + "description": "If disabled, metrics from this exporter will not be collected." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "HTTP basic auth username for collecting metrics." + }, + "scheme": { + "type": "string", + "description": "Scheme to generate URI to exporter metrics endpoints." + }, + "metrics_path": { + "type": "string", + "description": "Path under which metrics are exposed, used to generate URI." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname verification." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + } + }, + "description": "ExternalExporter runs on any Node type, including Remote Node." + }, + "v1ExternalService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this service instance runs." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "group": { + "type": "string", + "description": "Group name of external service." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP)." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port." + } + }, + "description": "ExternalService represents a generic External service instance." + }, + "v1ExternalServiceResult": { + "type": "object", + "properties": { + "service": { + "$ref": "#/definitions/v1ExternalService" + }, + "external_exporter": { + "$ref": "#/definitions/v1ExternalExporter" + } + } + }, + "v1GenericNode": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "address": { + "type": "string", + "description": "Node address (DNS name or IP)." + }, + "machine_id": { + "type": "string", + "description": "Linux machine-id." + }, + "distro": { + "type": "string", + "description": "Linux distribution name and version." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "is_pmm_server_node": { + "type": "boolean", + "description": "True if this node is a PMM Server node (HA mode)." + } + }, + "description": "GenericNode represents a bare metal server or virtual machine." + }, + "v1GetNodeResponse": { + "type": "object", + "properties": { + "node": { + "$ref": "#/definitions/v1UniversalNode" + } + } + }, + "v1HAProxyService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this service instance runs." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + } + }, + "description": "HAProxyService represents a generic HAProxy service instance." + }, + "v1HAProxyServiceResult": { + "type": "object", + "properties": { + "service": { + "$ref": "#/definitions/v1HAProxyService" + }, + "external_exporter": { + "$ref": "#/definitions/v1ExternalExporter" + } + } + }, + "v1ListAgentVersionsResponse": { + "type": "object", + "properties": { + "agent_versions": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AgentVersions" + }, + "description": "List of Agent versions." + } + } + }, + "v1ListAgentsResponse": { + "type": "object", + "properties": { + "agents": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1UniversalAgent" + }, + "description": "List of Agents." + } + } + }, + "v1ListNodesResponse": { + "type": "object", + "properties": { + "nodes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1UniversalNode" + } + } + } + }, + "v1ListServicesResponse": { + "type": "object", + "properties": { + "services": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1UniversalService" + }, + "description": "List of Services." + } + } + }, + "v1LogLevel": { + "type": "string", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "default": "LOG_LEVEL_UNSPECIFIED", + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "title": "Log level for exporters" + }, + "v1MetricsMode": { + "type": "string", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ], + "default": "METRICS_MODE_UNSPECIFIED", + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto" + }, + "v1MongoDBExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MongoDB username for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "disabled_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of disabled collector names." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "stats_collections": { + "type": "array", + "items": { + "type": "string" + }, + "title": "List of colletions to get stats from. Can use *" + }, + "collections_limit": { + "type": "integer", + "format": "int32", + "title": "Collections limit. Only get Databases and collection stats if the total number of collections in the server\nis less than this value. 0: no limit" + }, + "enable_all_collectors": { + "type": "boolean", + "description": "Enable all collectors." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "environment_variable_names": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Environment variable names passed to the exporter." + } + }, + "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics." + }, + "v1MongoDBService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "version": { + "type": "string", + "description": "MongoDB version." + } + }, + "description": "MongoDBService represents a generic MongoDB instance." + }, + "v1MongoDBServiceResult": { + "type": "object", + "properties": { + "service": { + "$ref": "#/definitions/v1MongoDBService" + }, + "mongodb_exporter": { + "$ref": "#/definitions/v1MongoDBExporter" + }, + "qan_mongodb_profiler": { + "$ref": "#/definitions/v1QANMongoDBProfilerAgent" + }, + "qan_mongodb_mongolog": { + "$ref": "#/definitions/v1QANMongoDBMongologAgent" + }, + "rta_mongodb_agent": { + "$ref": "#/definitions/v1RTAMongoDBAgent" + } + } + }, + "v1MySQLService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "version": { + "type": "string", + "description": "MySQL version." + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra parameters to be added to the DSN." + } + }, + "description": "MySQLService represents a generic MySQL instance." + }, + "v1MySQLServiceResult": { + "type": "object", + "properties": { + "service": { + "$ref": "#/definitions/v1MySQLService" + }, + "mysqld_exporter": { + "$ref": "#/definitions/v1MySQLdExporter" + }, + "qan_mysql_perfschema": { + "$ref": "#/definitions/v1QANMySQLPerfSchemaAgent" + }, + "qan_mysql_slowlog": { + "$ref": "#/definitions/v1QANMySQLSlowlogAgent" + }, + "table_count": { + "type": "integer", + "format": "int32", + "description": "Actual table count at the moment of adding." + } + } + }, + "v1MySQLdExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MySQL username for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "tls_cert": { + "type": "string", + "description": "Client certificate." + }, + "tls_key": { + "type": "string", + "description": "Password for decrypting tls_cert." + }, + "tablestats_group_table_limit": { + "type": "integer", + "format": "int32", + "description": "Tablestats group collectors are disabled if there are more than that number of tables.\n0 means tablestats group collectors are always enabled (no limit).\nNegative value means tablestats group collectors are always disabled." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "disabled_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of disabled collector names." + }, + "table_count": { + "type": "integer", + "format": "int32", + "description": "Actual table count at the moment of adding." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "tablestats_group_disabled": { + "type": "boolean", + "description": "True if tablestats group collectors are currently disabled." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra DSN parameters for MySQL connection." + } + }, + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics." + }, + "v1NodeType": { + "type": "string", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ], + "default": "NODE_TYPE_UNSPECIFIED", + "description": "NodeType describes supported Node types." + }, + "v1PMMAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "runs_on_node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "connected": { + "type": "boolean", + "description": "True if Agent is running and connected to pmm-managed." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + } + }, + "description": "PMMAgent runs on Generic or Container Node." + }, + "v1PostgreSQLService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "database_name": { + "type": "string", + "description": "Database name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "version": { + "type": "string", + "description": "PostgreSQL version." + }, + "auto_discovery_limit": { + "type": "integer", + "format": "int32", + "description": "Limit of databases for auto-discovery." + } + }, + "description": "PostgreSQLService represents a generic PostgreSQL instance." + }, + "v1PostgreSQLServiceResult": { + "type": "object", + "properties": { + "service": { + "$ref": "#/definitions/v1PostgreSQLService" + }, + "postgres_exporter": { + "$ref": "#/definitions/v1PostgresExporter" + }, + "qan_postgresql_pgstatements_agent": { + "$ref": "#/definitions/v1QANPostgreSQLPgStatementsAgent" + }, + "qan_postgresql_pgstatmonitor_agent": { + "$ref": "#/definitions/v1QANPostgreSQLPgStatMonitorAgent" + }, + "warning": { + "type": "string", + "description": "Warning message." + } + } + }, + "v1PostgresExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "PostgreSQL username for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "disabled_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of disabled collector names." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "auto_discovery_limit": { + "type": "integer", + "format": "int32", + "description": "Limit of databases for auto-discovery." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "max_exporter_connections": { + "type": "integer", + "format": "int32", + "description": "Maximum number of connections that exporter can open to the database instance." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + } + }, + "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics." + }, + "v1ProxySQLExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "ProxySQL username for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "disabled_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of disabled collector names." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + } + }, + "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics." + }, + "v1ProxySQLService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "version": { + "type": "string", + "description": "ProxySQL version." + } + }, + "description": "ProxySQLService represents a generic ProxySQL instance." + }, + "v1ProxySQLServiceResult": { + "type": "object", + "properties": { + "service": { + "$ref": "#/definitions/v1ProxySQLService" + }, + "proxysql_exporter": { + "$ref": "#/definitions/v1ProxySQLExporter" + } + } + }, + "v1QANMongoDBMongologAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MongoDB username for getting profiler data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + }, + "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server." + }, + "v1QANMongoDBProfilerAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MongoDB username for getting profiler data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + }, + "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server." + }, + "v1QANMySQLPerfSchemaAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MySQL username for getting performance data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "tls_cert": { + "type": "string", + "description": "Client certificate." + }, + "tls_key": { + "type": "string", + "description": "Password for decrypting tls_cert." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "query_examples_disabled": { + "type": "boolean", + "description": "True if query examples are disabled." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra DSN parameters for MySQL connection." + } + }, + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server." + }, + "v1QANMySQLSlowlogAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MySQL username for getting performance data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "tls_ca": { + "type": "string", + "description": "Certificate Authority certificate chain." + }, + "tls_cert": { + "type": "string", + "description": "Client certificate." + }, + "tls_key": { + "type": "string", + "description": "Password for decrypting tls_cert." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "title": "Limit query length in QAN (default: server-defined; -1: no limit)" + }, + "query_examples_disabled": { + "type": "boolean", + "description": "True if query examples are disabled." + }, + "max_slowlog_file_size": { + "type": "string", + "format": "int64", + "description": "Slowlog file is rotated at this size if \u003e 0." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "title": "mod tidy" + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "extra_dsn_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Extra DSN parameters for MySQL connection." + } + }, + "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server." + }, + "v1QANPostgreSQLPgStatMonitorAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "PostgreSQL username for getting pg stat monitor data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "query_examples_disabled": { + "type": "boolean", + "description": "True if query examples are disabled." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + }, + "description": "QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server." + }, + "v1QANPostgreSQLPgStatementsAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "PostgreSQL username for getting pg stat statements data." + }, + "disable_comments_parsing": { + "type": "boolean", + "description": "Disable parsing comments from queries and showing them in QAN." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN (default: server-defined; -1: no limit)." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + }, + "description": "QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server." + }, + "v1RDSExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "node_id": { + "type": "string", + "description": "Node identifier." + }, + "aws_access_key": { + "type": "string", + "description": "AWS Access Key." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status (the same for several configurations)." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics (the same for several configurations)." + }, + "basic_metrics_disabled": { + "type": "boolean", + "description": "Basic metrics are disabled." + }, + "enhanced_metrics_disabled": { + "type": "boolean", + "description": "Enhanced metrics are disabled." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "auto_discovery_limit": { + "type": "integer", + "format": "int32", + "description": "Limit of databases for auto-discovery." + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + } + }, + "description": "RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics." + }, + "v1RDSServiceResult": { + "type": "object", + "properties": { + "node": { + "$ref": "#/definitions/v1RemoteRDSNode" + }, + "rds_exporter": { + "$ref": "#/definitions/v1RDSExporter" + }, + "mysql": { + "$ref": "#/definitions/v1MySQLService" + }, + "mysqld_exporter": { + "$ref": "#/definitions/v1MySQLdExporter" + }, + "qan_mysql_perfschema": { + "$ref": "#/definitions/v1QANMySQLPerfSchemaAgent" + }, + "postgresql": { + "$ref": "#/definitions/v1PostgreSQLService" + }, + "postgresql_exporter": { + "$ref": "#/definitions/v1PostgresExporter" + }, + "qan_postgresql_pgstatements": { + "$ref": "#/definitions/v1QANPostgreSQLPgStatementsAgent" + } + } + }, + "v1RTAMongoDBAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique agent identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "MongoDB username for getting profiler data." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "rta_options": { + "$ref": "#/definitions/v1RTAOptions", + "description": "Real-Time Analytics options." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + } + }, + "description": "RTAMongoDBAgent runs within pmm-agent and sends MongoDB Real-Time Query Analytics data to the PMM Server." + }, + "v1RTAOptions": { + "type": "object", + "properties": { + "collect_interval": { + "type": "string", + "description": "Query collect interval (default 2s is set by server)." + } + }, + "description": "RTAOptions holds Real-Time Query Analytics agent options." + }, + "v1RegisterNodeRequest": { + "type": "object", + "properties": { + "node_type": { + "$ref": "#/definitions/v1NodeType", + "description": "Node type to be registered." + }, + "node_name": { + "type": "string", + "description": "A user-defined name unique across all Nodes." + }, + "address": { + "type": "string", + "description": "Node address (DNS name or IP)." + }, + "machine_id": { + "type": "string", + "description": "Linux machine-id." + }, + "distro": { + "type": "string", + "description": "Linux distribution name and version." + }, + "container_id": { + "type": "string", + "description": "Container identifier. If specified, must be a unique Docker container identifier." + }, + "container_name": { + "type": "string", + "description": "Container name." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels for Node." + }, + "reregister": { + "type": "boolean", + "description": "If true, and Node with that name already exist, it will be removed with all dependent Services and Agents." + }, + "metrics_mode": { + "$ref": "#/definitions/v1MetricsMode", + "description": "Defines metrics flow model for node_exporter being added by this request.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically." + }, + "disable_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of collector names to disable in this exporter." + }, + "agent_password": { + "type": "string", + "description": "Custom password for exporter endpoint /metrics." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "instance_id": { + "type": "string", + "description": "AWS instance ID." + } + } + }, + "v1RegisterNodeResponse": { + "type": "object", + "properties": { + "generic_node": { + "$ref": "#/definitions/v1GenericNode" + }, + "container_node": { + "$ref": "#/definitions/v1ContainerNode" + }, + "pmm_agent": { + "$ref": "#/definitions/v1PMMAgent" + }, + "token": { + "type": "string", + "description": "Token represents token for vmagent auth config." + }, + "warning": { + "type": "string", + "description": "Warning message." + } + } + }, + "v1RemoteRDSNode": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "node_name": { + "type": "string", + "description": "Unique across all Nodes user-defined name." + }, + "address": { + "type": "string", + "description": "DB instance identifier." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "instance_id": { + "type": "string", + "description": "AWS instance ID." + } + }, + "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes." + }, + "v1RemoveServiceResponse": { + "type": "object" + }, + "v1ServiceType": { + "type": "string", + "enum": [ + "SERVICE_TYPE_UNSPECIFIED", + "SERVICE_TYPE_MYSQL_SERVICE", + "SERVICE_TYPE_MONGODB_SERVICE", + "SERVICE_TYPE_POSTGRESQL_SERVICE", + "SERVICE_TYPE_VALKEY_SERVICE", + "SERVICE_TYPE_PROXYSQL_SERVICE", + "SERVICE_TYPE_HAPROXY_SERVICE", + "SERVICE_TYPE_EXTERNAL_SERVICE" + ], + "default": "SERVICE_TYPE_UNSPECIFIED", + "description": "ServiceType describes supported Service types." + }, + "v1UniversalAgent": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique agent identifier." + }, + "is_agent_password_set": { + "type": "boolean", + "description": "True if the agent password is set." + }, + "agent_type": { + "type": "string", + "description": "Agent type." + }, + "aws_access_key": { + "type": "string", + "description": "AWS Access Key." + }, + "is_aws_secret_key_set": { + "type": "boolean", + "description": "True if AWS Secret Key is set." + }, + "azure_options": { + "$ref": "#/definitions/UniversalAgentAzureOptions", + "description": "Options used for connecting to Azure." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Creation timestamp." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "disabled_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of disabled collector names." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "log_level": { + "$ref": "#/definitions/v1LogLevel", + "description": "Log level for exporter." + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "description": "Limit query length in QAN." + }, + "max_query_log_size": { + "type": "string", + "format": "int64", + "description": "Limit query log size in QAN." + }, + "metrics_path": { + "type": "string", + "description": "Path under which metrics are exposed, used to generate URI." + }, + "metrics_scheme": { + "type": "string", + "description": "Scheme to generate URI to exporter metrics endpoints." + }, + "mongo_db_options": { + "$ref": "#/definitions/UniversalAgentMongoDBOptions", + "description": "TLS and other options for connecting to MongoDB." + }, + "mysql_options": { + "$ref": "#/definitions/UniversalAgentMySQLOptions", + "description": "TLS and other options for connecting to MySQL." + }, + "node_id": { + "type": "string", + "description": "A unique node identifier." + }, + "is_password_set": { + "type": "boolean", + "description": "True if password for connecting the agent to the database is set." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier." + }, + "postgresql_options": { + "$ref": "#/definitions/UniversalAgentPostgreSQLOptions", + "description": "TLS options for connecting to PostgreSQL." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "push_metrics": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "query_examples_disabled": { + "type": "boolean", + "description": "True if query examples are disabled." + }, + "comments_parsing_disabled": { + "type": "boolean", + "description": "True if query comments parsing is disabled." + }, + "rds_basic_metrics_disabled": { + "type": "boolean", + "description": "True if RDS basic metrics are disdabled." + }, + "rds_enhanced_metrics_disabled": { + "type": "boolean", + "description": "True if RDS enhanced metrics are disdabled." + }, + "runs_on_node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "status": { + "type": "string", + "description": "Actual Agent status." + }, + "table_count": { + "type": "integer", + "format": "int32", + "description": "Last known table count." + }, + "table_count_tablestats_group_limit": { + "type": "integer", + "format": "int32", + "description": "Tablestats group collectors are disabled if there are more than that number of tables.\n0 means tablestats group collectors are always enabled (no limit).\nNegative value means tablestats group collectors are always disabled." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname validation." + }, + "username": { + "type": "string", + "description": "HTTP basic auth username for collecting metrics." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Last update timestamp." + }, + "version": { + "type": "string", + "description": "Agent version." + }, + "is_connected": { + "type": "boolean", + "description": "True if Agent is running and connected to pmm-managed." + }, + "expose_exporter": { + "type": "boolean", + "description": "True if an exporter agent is exposed on all host addresses." + }, + "valkey_options": { + "$ref": "#/definitions/UniversalAgentValkeyOptions", + "description": "Options for connecting to Valkey." + }, + "rta_options": { + "$ref": "#/definitions/v1RTAOptions", + "description": "Real-Time Analytics options." + } + } + }, + "v1UniversalNode": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "Unique Node identifier." + }, + "node_type": { + "type": "string", + "description": "Node type." + }, + "node_name": { + "type": "string", + "description": "User-defined node name." + }, + "machine_id": { + "type": "string", + "description": "Linux machine-id." + }, + "distro": { + "type": "string", + "description": "Linux distribution name and version." + }, + "node_model": { + "type": "string", + "description": "Node model." + }, + "container_id": { + "type": "string", + "description": "A node's unique docker container identifier." + }, + "container_name": { + "type": "string", + "description": "Container name." + }, + "address": { + "type": "string", + "description": "Node address (DNS name or IP)." + }, + "region": { + "type": "string", + "description": "Node region." + }, + "az": { + "type": "string", + "description": "Node availability zone." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels for Node." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Creation timestamp." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Last update timestamp." + }, + "status": { + "$ref": "#/definitions/v1UniversalNodeStatus", + "description": "The health status of the node." + }, + "agents": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/UniversalNodeAgent" + }, + "description": "List of agents related to this node." + }, + "services": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/UniversalNodeService" + }, + "description": "List of services running on this node." + }, + "instance_id": { + "type": "string", + "description": "Instance ID for cloud providers (e.g. AWS RDS)." + }, + "is_pmm_server_node": { + "type": "boolean", + "description": "True if this node is a PMM Server node (HA mode)." + } + } + }, + "v1UniversalNodeStatus": { + "type": "string", + "enum": [ + "STATUS_UNSPECIFIED", + "STATUS_UP", + "STATUS_DOWN", + "STATUS_UNKNOWN" + ], + "default": "STATUS_UNSPECIFIED", + "description": "Node status.\n\n - STATUS_UNSPECIFIED: Invalid status.\n - STATUS_UP: The node is up.\n - STATUS_DOWN: The node is down.\n - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet)." + }, + "v1UniversalService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique service identifier." + }, + "service_type": { + "type": "string", + "description": "Service type." + }, + "service_name": { + "type": "string", + "description": "User-defined name unique across all Services." + }, + "database_name": { + "type": "string", + "description": "Database name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "node_name": { + "type": "string", + "description": "Node name where this instance runs." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels for Service." + }, + "external_group": { + "type": "string", + "description": "External group name." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Creation timestamp." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Last update timestamp." + }, + "agents": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1UniversalAgent" + }, + "description": "List of agents related to this service." + }, + "status": { + "$ref": "#/definitions/v1UniversalServiceStatus", + "description": "The health status of the service." + }, + "version": { + "type": "string", + "description": "The service/database version." + } + } + }, + "v1UniversalServiceStatus": { + "type": "string", + "enum": [ + "STATUS_UNSPECIFIED", + "STATUS_UP", + "STATUS_DOWN", + "STATUS_UNKNOWN" + ], + "default": "STATUS_UNSPECIFIED", + "description": "Service status.\n\n - STATUS_UNSPECIFIED: In case we don't support the db vendor yet.\n - STATUS_UP: The service is up.\n - STATUS_DOWN: The service is down.\n - STATUS_UNKNOWN: The service's status cannot be known (e.g. there are no metrics yet)." + }, + "v1UnregisterNodeResponse": { + "type": "object", + "properties": { + "warning": { + "type": "string", + "description": "Warning message if there are more service tokens attached to service account." + } + } + }, + "v1UpdateSeverity": { + "type": "string", + "enum": [ + "UPDATE_SEVERITY_UNSPECIFIED", + "UPDATE_SEVERITY_UNSUPPORTED", + "UPDATE_SEVERITY_UP_TO_DATE", + "UPDATE_SEVERITY_REQUIRED", + "UPDATE_SEVERITY_CRITICAL" + ], + "default": "UPDATE_SEVERITY_UNSPECIFIED", + "description": " - UPDATE_SEVERITY_UNSUPPORTED: The client version is newer than the server version.\n - UPDATE_SEVERITY_UP_TO_DATE: The client version matches the server version.\n - UPDATE_SEVERITY_REQUIRED: The client's minor or patch version is older.\n - UPDATE_SEVERITY_CRITICAL: The client's major version is older." + }, + "v1ValkeyExporter": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "pmm_agent_id": { + "type": "string", + "description": "The pmm-agent identifier which runs this instance." + }, + "disabled": { + "type": "boolean", + "description": "Desired Agent status: enabled (false) or disabled (true)." + }, + "service_id": { + "type": "string", + "description": "Service identifier." + }, + "username": { + "type": "string", + "description": "Valkey username for scraping metrics." + }, + "tls": { + "type": "boolean", + "description": "Use TLS for database connections." + }, + "tls_skip_verify": { + "type": "boolean", + "description": "Skip TLS certificate and hostname verification." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "push_metrics_enabled": { + "type": "boolean", + "description": "True if exporter uses push metrics mode." + }, + "disabled_collectors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of disabled collector names." + }, + "status": { + "$ref": "#/definitions/v1AgentStatus", + "description": "Actual Agent status." + }, + "listen_port": { + "type": "integer", + "format": "int64", + "description": "Listen port for scraping metrics." + }, + "process_exec_path": { + "type": "string", + "description": "Path to exec process." + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces" + }, + "metrics_resolutions": { + "$ref": "#/definitions/commonMetricsResolutions", + "description": "Metrics resolution for this agent." + } + }, + "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey Service metrics." + }, + "v1ValkeyService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "version": { + "type": "string", + "description": "Valkey version." + } + }, + "description": "ValkeyService represents a generic Valkey instance." + }, + "v1ValkeyServiceResult": { + "type": "object", + "properties": { + "service": { + "$ref": "#/definitions/v1ValkeyService" + }, + "valkey_exporter": { + "$ref": "#/definitions/v1ValkeyExporter" + } + } + } + } +} diff --git a/api/management/v1/service_grpc.pb.go b/api/management/v1/service_grpc.pb.go index b50380dc4b5..fbd5ee9d9ad 100644 --- a/api/management/v1/service_grpc.pb.go +++ b/api/management/v1/service_grpc.pb.go @@ -8,7 +8,6 @@ package managementv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -20,19 +19,20 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - ManagementService_AddAnnotation_FullMethodName = "/management.v1.ManagementService/AddAnnotation" - ManagementService_ListAgents_FullMethodName = "/management.v1.ManagementService/ListAgents" - ManagementService_ListAgentVersions_FullMethodName = "/management.v1.ManagementService/ListAgentVersions" - ManagementService_RegisterNode_FullMethodName = "/management.v1.ManagementService/RegisterNode" - ManagementService_UnregisterNode_FullMethodName = "/management.v1.ManagementService/UnregisterNode" - ManagementService_ListNodes_FullMethodName = "/management.v1.ManagementService/ListNodes" - ManagementService_GetNode_FullMethodName = "/management.v1.ManagementService/GetNode" - ManagementService_AddService_FullMethodName = "/management.v1.ManagementService/AddService" - ManagementService_ListServices_FullMethodName = "/management.v1.ManagementService/ListServices" - ManagementService_DiscoverRDS_FullMethodName = "/management.v1.ManagementService/DiscoverRDS" - ManagementService_DiscoverAzureDatabase_FullMethodName = "/management.v1.ManagementService/DiscoverAzureDatabase" - ManagementService_AddAzureDatabase_FullMethodName = "/management.v1.ManagementService/AddAzureDatabase" - ManagementService_RemoveService_FullMethodName = "/management.v1.ManagementService/RemoveService" + ManagementService_AddAnnotation_FullMethodName = "/management.v1.ManagementService/AddAnnotation" + ManagementService_ListAgents_FullMethodName = "/management.v1.ManagementService/ListAgents" + ManagementService_ListAgentVersions_FullMethodName = "/management.v1.ManagementService/ListAgentVersions" + ManagementService_RegisterNode_FullMethodName = "/management.v1.ManagementService/RegisterNode" + ManagementService_UnregisterNode_FullMethodName = "/management.v1.ManagementService/UnregisterNode" + ManagementService_ListNodes_FullMethodName = "/management.v1.ManagementService/ListNodes" + ManagementService_GetNode_FullMethodName = "/management.v1.ManagementService/GetNode" + ManagementService_CreateNodeInstallToken_FullMethodName = "/management.v1.ManagementService/CreateNodeInstallToken" + ManagementService_AddService_FullMethodName = "/management.v1.ManagementService/AddService" + ManagementService_ListServices_FullMethodName = "/management.v1.ManagementService/ListServices" + ManagementService_DiscoverRDS_FullMethodName = "/management.v1.ManagementService/DiscoverRDS" + ManagementService_DiscoverAzureDatabase_FullMethodName = "/management.v1.ManagementService/DiscoverAzureDatabase" + ManagementService_AddAzureDatabase_FullMethodName = "/management.v1.ManagementService/AddAzureDatabase" + ManagementService_RemoveService_FullMethodName = "/management.v1.ManagementService/RemoveService" ) // ManagementServiceClient is the client API for ManagementService service. @@ -55,6 +55,8 @@ type ManagementServiceClient 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) + // CreateNodeInstallToken mints a short-lived Grafana token for PMM Client installation scripts (no inventory rows). + CreateNodeInstallToken(ctx context.Context, in *CreateNodeInstallTokenRequest, opts ...grpc.CallOption) (*CreateNodeInstallTokenResponse, error) // AddService adds a Service and starts several Agents. AddService(ctx context.Context, in *AddServiceRequest, opts ...grpc.CallOption) (*AddServiceResponse, error) // ListServices returns a list of Services with a rich set of properties. @@ -147,6 +149,16 @@ func (c *managementServiceClient) GetNode(ctx context.Context, in *GetNodeReques return out, nil } +func (c *managementServiceClient) CreateNodeInstallToken(ctx context.Context, in *CreateNodeInstallTokenRequest, opts ...grpc.CallOption) (*CreateNodeInstallTokenResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CreateNodeInstallTokenResponse) + err := c.cc.Invoke(ctx, ManagementService_CreateNodeInstallToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *managementServiceClient) AddService(ctx context.Context, in *AddServiceRequest, opts ...grpc.CallOption) (*AddServiceResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AddServiceResponse) @@ -227,6 +239,8 @@ type ManagementServiceServer interface { ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) // GetNode returns a single Node by ID. GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) + // CreateNodeInstallToken mints a short-lived Grafana token for PMM Client installation scripts (no inventory rows). + CreateNodeInstallToken(context.Context, *CreateNodeInstallTokenRequest) (*CreateNodeInstallTokenResponse, error) // AddService adds a Service and starts several Agents. AddService(context.Context, *AddServiceRequest) (*AddServiceResponse, error) // ListServices returns a list of Services with a rich set of properties. @@ -252,51 +266,42 @@ type UnimplementedManagementServiceServer struct{} func (UnimplementedManagementServiceServer) AddAnnotation(context.Context, *AddAnnotationRequest) (*AddAnnotationResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddAnnotation not implemented") } - func (UnimplementedManagementServiceServer) ListAgents(context.Context, *ListAgentsRequest) (*ListAgentsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAgents not implemented") } - func (UnimplementedManagementServiceServer) ListAgentVersions(context.Context, *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAgentVersions not implemented") } - func (UnimplementedManagementServiceServer) RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method RegisterNode not implemented") } - func (UnimplementedManagementServiceServer) UnregisterNode(context.Context, *UnregisterNodeRequest) (*UnregisterNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method UnregisterNode not implemented") } - func (UnimplementedManagementServiceServer) ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListNodes not implemented") } - func (UnimplementedManagementServiceServer) GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetNode not implemented") } - +func (UnimplementedManagementServiceServer) CreateNodeInstallToken(context.Context, *CreateNodeInstallTokenRequest) (*CreateNodeInstallTokenResponse, error) { + return nil, status.Error(codes.Unimplemented, "method CreateNodeInstallToken not implemented") +} func (UnimplementedManagementServiceServer) AddService(context.Context, *AddServiceRequest) (*AddServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddService not implemented") } - func (UnimplementedManagementServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListServices not implemented") } - func (UnimplementedManagementServiceServer) DiscoverRDS(context.Context, *DiscoverRDSRequest) (*DiscoverRDSResponse, error) { return nil, status.Error(codes.Unimplemented, "method DiscoverRDS not implemented") } - func (UnimplementedManagementServiceServer) DiscoverAzureDatabase(context.Context, *DiscoverAzureDatabaseRequest) (*DiscoverAzureDatabaseResponse, error) { return nil, status.Error(codes.Unimplemented, "method DiscoverAzureDatabase not implemented") } - func (UnimplementedManagementServiceServer) AddAzureDatabase(context.Context, *AddAzureDatabaseRequest) (*AddAzureDatabaseResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddAzureDatabase not implemented") } - func (UnimplementedManagementServiceServer) RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveService not implemented") } @@ -447,6 +452,24 @@ func _ManagementService_GetNode_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _ManagementService_CreateNodeInstallToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateNodeInstallTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ManagementServiceServer).CreateNodeInstallToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ManagementService_CreateNodeInstallToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ManagementServiceServer).CreateNodeInstallToken(ctx, req.(*CreateNodeInstallTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _ManagementService_AddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddServiceRequest) if err := dec(in); err != nil { @@ -590,6 +613,10 @@ var ManagementService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetNode", Handler: _ManagementService_GetNode_Handler, }, + { + MethodName: "CreateNodeInstallToken", + Handler: _ManagementService_CreateNodeInstallToken_Handler, + }, { MethodName: "AddService", Handler: _ManagementService_AddService_Handler, diff --git a/api/management/v1/severity.pb.go b/api/management/v1/severity.pb.go index 93408b544e2..dccdc65ddca 100644 --- a/api/management/v1/severity.pb.go +++ b/api/management/v1/severity.pb.go @@ -7,12 +7,11 @@ package managementv1 import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -119,13 +118,10 @@ func file_management_v1_severity_proto_rawDescGZIP() []byte { return file_management_v1_severity_proto_rawDescData } -var ( - file_management_v1_severity_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_management_v1_severity_proto_goTypes = []any{ - (Severity)(0), // 0: management.v1.Severity - } -) - +var file_management_v1_severity_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_management_v1_severity_proto_goTypes = []any{ + (Severity)(0), // 0: management.v1.Severity +} var file_management_v1_severity_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/management/v1/severity.swagger.json b/api/management/v1/severity.swagger.json new file mode 100644 index 00000000000..251bda17116 --- /dev/null +++ b/api/management/v1/severity.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/severity.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/management/v1/valkey.pb.go b/api/management/v1/valkey.pb.go index 37723eea5ec..50e0848541e 100644 --- a/api/management/v1/valkey.pb.go +++ b/api/management/v1/valkey.pb.go @@ -7,15 +7,13 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" + v1 "github.com/percona/pmm/api/inventory/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -391,20 +389,17 @@ func file_management_v1_valkey_proto_rawDescGZIP() []byte { return file_management_v1_valkey_proto_rawDescData } -var ( - file_management_v1_valkey_proto_msgTypes = make([]protoimpl.MessageInfo, 3) - file_management_v1_valkey_proto_goTypes = []any{ - (*AddValkeyServiceParams)(nil), // 0: management.v1.AddValkeyServiceParams - (*ValkeyServiceResult)(nil), // 1: management.v1.ValkeyServiceResult - nil, // 2: management.v1.AddValkeyServiceParams.CustomLabelsEntry - (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams - (MetricsMode)(0), // 4: management.v1.MetricsMode - (v1.LogLevel)(0), // 5: inventory.v1.LogLevel - (*v1.ValkeyService)(nil), // 6: inventory.v1.ValkeyService - (*v1.ValkeyExporter)(nil), // 7: inventory.v1.ValkeyExporter - } -) - +var file_management_v1_valkey_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_management_v1_valkey_proto_goTypes = []any{ + (*AddValkeyServiceParams)(nil), // 0: management.v1.AddValkeyServiceParams + (*ValkeyServiceResult)(nil), // 1: management.v1.ValkeyServiceResult + nil, // 2: management.v1.AddValkeyServiceParams.CustomLabelsEntry + (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams + (MetricsMode)(0), // 4: management.v1.MetricsMode + (v1.LogLevel)(0), // 5: inventory.v1.LogLevel + (*v1.ValkeyService)(nil), // 6: inventory.v1.ValkeyService + (*v1.ValkeyExporter)(nil), // 7: inventory.v1.ValkeyExporter +} var file_management_v1_valkey_proto_depIdxs = []int32{ 3, // 0: management.v1.AddValkeyServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddValkeyServiceParams.custom_labels:type_name -> management.v1.AddValkeyServiceParams.CustomLabelsEntry diff --git a/api/management/v1/valkey.pb.validate.go b/api/management/v1/valkey.pb.validate.go index 55268da8d34..a2260070a98 100644 --- a/api/management/v1/valkey.pb.validate.go +++ b/api/management/v1/valkey.pb.validate.go @@ -62,6 +62,7 @@ func (m *AddValkeyServiceParams) validate(all bool) error { var errors []error if m.GetNodeId() != "" { + if utf8.RuneCountInString(m.GetNodeId()) < 1 { err := AddValkeyServiceParamsValidationError{ field: "NodeId", @@ -72,9 +73,11 @@ func (m *AddValkeyServiceParams) validate(all bool) error { } errors = append(errors, err) } + } if m.GetNodeName() != "" { + if utf8.RuneCountInString(m.GetNodeName()) < 1 { err := AddValkeyServiceParamsValidationError{ field: "NodeName", @@ -85,6 +88,7 @@ func (m *AddValkeyServiceParams) validate(all bool) error { } errors = append(errors, err) } + } if all { diff --git a/api/management/v1/valkey.swagger.json b/api/management/v1/valkey.swagger.json new file mode 100644 index 00000000000..a0170f19df2 --- /dev/null +++ b/api/management/v1/valkey.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "management/v1/valkey.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googleRpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/api/qan/v1/collector.pb.go b/api/qan/v1/collector.pb.go index 34b292da2f9..b53102e8a73 100644 --- a/api/qan/v1/collector.pb.go +++ b/api/qan/v1/collector.pb.go @@ -7,15 +7,13 @@ package qanv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - + v1 "github.com/percona/pmm/api/inventory/v1" _ "google.golang.org/genproto/googleapis/api/visibility" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -2743,20 +2741,17 @@ func file_qan_v1_collector_proto_rawDescGZIP() []byte { return file_qan_v1_collector_proto_rawDescData } -var ( - file_qan_v1_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 6) - file_qan_v1_collector_proto_goTypes = []any{ - (*CollectRequest)(nil), // 0: qan.v1.CollectRequest - (*MetricsBucket)(nil), // 1: qan.v1.MetricsBucket - (*CollectResponse)(nil), // 2: qan.v1.CollectResponse - nil, // 3: qan.v1.MetricsBucket.LabelsEntry - nil, // 4: qan.v1.MetricsBucket.WarningsEntry - nil, // 5: qan.v1.MetricsBucket.ErrorsEntry - (v1.AgentType)(0), // 6: inventory.v1.AgentType - (ExampleType)(0), // 7: qan.v1.ExampleType - } -) - +var file_qan_v1_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_qan_v1_collector_proto_goTypes = []any{ + (*CollectRequest)(nil), // 0: qan.v1.CollectRequest + (*MetricsBucket)(nil), // 1: qan.v1.MetricsBucket + (*CollectResponse)(nil), // 2: qan.v1.CollectResponse + nil, // 3: qan.v1.MetricsBucket.LabelsEntry + nil, // 4: qan.v1.MetricsBucket.WarningsEntry + nil, // 5: qan.v1.MetricsBucket.ErrorsEntry + (v1.AgentType)(0), // 6: inventory.v1.AgentType + (ExampleType)(0), // 7: qan.v1.ExampleType +} var file_qan_v1_collector_proto_depIdxs = []int32{ 1, // 0: qan.v1.CollectRequest.metrics_bucket:type_name -> qan.v1.MetricsBucket 6, // 1: qan.v1.MetricsBucket.agent_type:type_name -> inventory.v1.AgentType diff --git a/api/qan/v1/collector.swagger.json b/api/qan/v1/collector.swagger.json new file mode 100644 index 00000000000..5313874d3b2 --- /dev/null +++ b/api/qan/v1/collector.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "qan/v1/collector.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/qan/v1/collector_grpc.pb.go b/api/qan/v1/collector_grpc.pb.go index e13e55d5599..99faa76e1ce 100644 --- a/api/qan/v1/collector_grpc.pb.go +++ b/api/qan/v1/collector_grpc.pb.go @@ -8,7 +8,6 @@ package qanv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/qan/v1/filters.pb.go b/api/qan/v1/filters.pb.go index fcbf5e7aead..cffe93c4255 100644 --- a/api/qan/v1/filters.pb.go +++ b/api/qan/v1/filters.pb.go @@ -7,13 +7,12 @@ package qanv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -281,19 +280,16 @@ func file_qan_v1_filters_proto_rawDescGZIP() []byte { return file_qan_v1_filters_proto_rawDescData } -var ( - file_qan_v1_filters_proto_msgTypes = make([]protoimpl.MessageInfo, 5) - file_qan_v1_filters_proto_goTypes = []any{ - (*GetFilteredMetricsNamesRequest)(nil), // 0: qan.v1.GetFilteredMetricsNamesRequest - (*GetFilteredMetricsNamesResponse)(nil), // 1: qan.v1.GetFilteredMetricsNamesResponse - (*ListLabels)(nil), // 2: qan.v1.ListLabels - (*Values)(nil), // 3: qan.v1.Values - nil, // 4: qan.v1.GetFilteredMetricsNamesResponse.LabelsEntry - (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp - (*MapFieldEntry)(nil), // 6: qan.v1.MapFieldEntry - } -) - +var file_qan_v1_filters_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_qan_v1_filters_proto_goTypes = []any{ + (*GetFilteredMetricsNamesRequest)(nil), // 0: qan.v1.GetFilteredMetricsNamesRequest + (*GetFilteredMetricsNamesResponse)(nil), // 1: qan.v1.GetFilteredMetricsNamesResponse + (*ListLabels)(nil), // 2: qan.v1.ListLabels + (*Values)(nil), // 3: qan.v1.Values + nil, // 4: qan.v1.GetFilteredMetricsNamesResponse.LabelsEntry + (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp + (*MapFieldEntry)(nil), // 6: qan.v1.MapFieldEntry +} var file_qan_v1_filters_proto_depIdxs = []int32{ 5, // 0: qan.v1.GetFilteredMetricsNamesRequest.period_start_from:type_name -> google.protobuf.Timestamp 5, // 1: qan.v1.GetFilteredMetricsNamesRequest.period_start_to:type_name -> google.protobuf.Timestamp diff --git a/api/qan/v1/filters.swagger.json b/api/qan/v1/filters.swagger.json new file mode 100644 index 00000000000..bd5c3eb7ba0 --- /dev/null +++ b/api/qan/v1/filters.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "qan/v1/filters.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/qan/v1/object_details.pb.go b/api/qan/v1/object_details.pb.go index 25c9db523a5..9a68f9f39d4 100644 --- a/api/qan/v1/object_details.pb.go +++ b/api/qan/v1/object_details.pb.go @@ -7,13 +7,12 @@ package qanv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -1608,42 +1607,39 @@ func file_qan_v1_object_details_proto_rawDescGZIP() []byte { return file_qan_v1_object_details_proto_rawDescData } -var ( - file_qan_v1_object_details_proto_msgTypes = make([]protoimpl.MessageInfo, 26) - file_qan_v1_object_details_proto_goTypes = []any{ - (*GetMetricsRequest)(nil), // 0: qan.v1.GetMetricsRequest - (*GetMetricsResponse)(nil), // 1: qan.v1.GetMetricsResponse - (*MetricValues)(nil), // 2: qan.v1.MetricValues - (*Labels)(nil), // 3: qan.v1.Labels - (*GetQueryExampleRequest)(nil), // 4: qan.v1.GetQueryExampleRequest - (*GetQueryExampleResponse)(nil), // 5: qan.v1.GetQueryExampleResponse - (*QueryExample)(nil), // 6: qan.v1.QueryExample - (*GetLabelsRequest)(nil), // 7: qan.v1.GetLabelsRequest - (*GetLabelsResponse)(nil), // 8: qan.v1.GetLabelsResponse - (*ListLabelValues)(nil), // 9: qan.v1.ListLabelValues - (*GetQueryPlanRequest)(nil), // 10: qan.v1.GetQueryPlanRequest - (*GetQueryPlanResponse)(nil), // 11: qan.v1.GetQueryPlanResponse - (*GetHistogramRequest)(nil), // 12: qan.v1.GetHistogramRequest - (*GetHistogramResponse)(nil), // 13: qan.v1.GetHistogramResponse - (*HistogramItem)(nil), // 14: qan.v1.HistogramItem - (*QueryExistsRequest)(nil), // 15: qan.v1.QueryExistsRequest - (*QueryExistsResponse)(nil), // 16: qan.v1.QueryExistsResponse - (*SchemaByQueryIDRequest)(nil), // 17: qan.v1.SchemaByQueryIDRequest - (*SchemaByQueryIDResponse)(nil), // 18: qan.v1.SchemaByQueryIDResponse - (*ExplainFingerprintByQueryIDRequest)(nil), // 19: qan.v1.ExplainFingerprintByQueryIDRequest - (*ExplainFingerprintByQueryIDResponse)(nil), // 20: qan.v1.ExplainFingerprintByQueryIDResponse - (*GetSelectedQueryMetadataResponse)(nil), // 21: qan.v1.GetSelectedQueryMetadataResponse - nil, // 22: qan.v1.GetMetricsResponse.MetricsEntry - nil, // 23: qan.v1.GetMetricsResponse.TextMetricsEntry - nil, // 24: qan.v1.GetMetricsResponse.TotalsEntry - nil, // 25: qan.v1.GetLabelsResponse.LabelsEntry - (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp - (*MapFieldEntry)(nil), // 27: qan.v1.MapFieldEntry - (*Point)(nil), // 28: qan.v1.Point - (ExampleType)(0), // 29: qan.v1.ExampleType - } -) - +var file_qan_v1_object_details_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_qan_v1_object_details_proto_goTypes = []any{ + (*GetMetricsRequest)(nil), // 0: qan.v1.GetMetricsRequest + (*GetMetricsResponse)(nil), // 1: qan.v1.GetMetricsResponse + (*MetricValues)(nil), // 2: qan.v1.MetricValues + (*Labels)(nil), // 3: qan.v1.Labels + (*GetQueryExampleRequest)(nil), // 4: qan.v1.GetQueryExampleRequest + (*GetQueryExampleResponse)(nil), // 5: qan.v1.GetQueryExampleResponse + (*QueryExample)(nil), // 6: qan.v1.QueryExample + (*GetLabelsRequest)(nil), // 7: qan.v1.GetLabelsRequest + (*GetLabelsResponse)(nil), // 8: qan.v1.GetLabelsResponse + (*ListLabelValues)(nil), // 9: qan.v1.ListLabelValues + (*GetQueryPlanRequest)(nil), // 10: qan.v1.GetQueryPlanRequest + (*GetQueryPlanResponse)(nil), // 11: qan.v1.GetQueryPlanResponse + (*GetHistogramRequest)(nil), // 12: qan.v1.GetHistogramRequest + (*GetHistogramResponse)(nil), // 13: qan.v1.GetHistogramResponse + (*HistogramItem)(nil), // 14: qan.v1.HistogramItem + (*QueryExistsRequest)(nil), // 15: qan.v1.QueryExistsRequest + (*QueryExistsResponse)(nil), // 16: qan.v1.QueryExistsResponse + (*SchemaByQueryIDRequest)(nil), // 17: qan.v1.SchemaByQueryIDRequest + (*SchemaByQueryIDResponse)(nil), // 18: qan.v1.SchemaByQueryIDResponse + (*ExplainFingerprintByQueryIDRequest)(nil), // 19: qan.v1.ExplainFingerprintByQueryIDRequest + (*ExplainFingerprintByQueryIDResponse)(nil), // 20: qan.v1.ExplainFingerprintByQueryIDResponse + (*GetSelectedQueryMetadataResponse)(nil), // 21: qan.v1.GetSelectedQueryMetadataResponse + nil, // 22: qan.v1.GetMetricsResponse.MetricsEntry + nil, // 23: qan.v1.GetMetricsResponse.TextMetricsEntry + nil, // 24: qan.v1.GetMetricsResponse.TotalsEntry + nil, // 25: qan.v1.GetLabelsResponse.LabelsEntry + (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp + (*MapFieldEntry)(nil), // 27: qan.v1.MapFieldEntry + (*Point)(nil), // 28: qan.v1.Point + (ExampleType)(0), // 29: qan.v1.ExampleType +} var file_qan_v1_object_details_proto_depIdxs = []int32{ 26, // 0: qan.v1.GetMetricsRequest.period_start_from:type_name -> google.protobuf.Timestamp 26, // 1: qan.v1.GetMetricsRequest.period_start_to:type_name -> google.protobuf.Timestamp diff --git a/api/qan/v1/object_details.swagger.json b/api/qan/v1/object_details.swagger.json new file mode 100644 index 00000000000..e5465adaa29 --- /dev/null +++ b/api/qan/v1/object_details.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "qan/v1/object_details.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/qan/v1/profile.pb.go b/api/qan/v1/profile.pb.go index 03ab97e871a..2dce8283404 100644 --- a/api/qan/v1/profile.pb.go +++ b/api/qan/v1/profile.pb.go @@ -7,13 +7,12 @@ package qanv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -584,21 +583,18 @@ func file_qan_v1_profile_proto_rawDescGZIP() []byte { return file_qan_v1_profile_proto_rawDescData } -var ( - file_qan_v1_profile_proto_msgTypes = make([]protoimpl.MessageInfo, 7) - file_qan_v1_profile_proto_goTypes = []any{ - (*GetReportRequest)(nil), // 0: qan.v1.GetReportRequest - (*ReportMapFieldEntry)(nil), // 1: qan.v1.ReportMapFieldEntry - (*GetReportResponse)(nil), // 2: qan.v1.GetReportResponse - (*Row)(nil), // 3: qan.v1.Row - (*Metric)(nil), // 4: qan.v1.Metric - (*Stat)(nil), // 5: qan.v1.Stat - nil, // 6: qan.v1.Row.MetricsEntry - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp - (*Point)(nil), // 8: qan.v1.Point - } -) - +var file_qan_v1_profile_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_qan_v1_profile_proto_goTypes = []any{ + (*GetReportRequest)(nil), // 0: qan.v1.GetReportRequest + (*ReportMapFieldEntry)(nil), // 1: qan.v1.ReportMapFieldEntry + (*GetReportResponse)(nil), // 2: qan.v1.GetReportResponse + (*Row)(nil), // 3: qan.v1.Row + (*Metric)(nil), // 4: qan.v1.Metric + (*Stat)(nil), // 5: qan.v1.Stat + nil, // 6: qan.v1.Row.MetricsEntry + (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp + (*Point)(nil), // 8: qan.v1.Point +} var file_qan_v1_profile_proto_depIdxs = []int32{ 7, // 0: qan.v1.GetReportRequest.period_start_from:type_name -> google.protobuf.Timestamp 7, // 1: qan.v1.GetReportRequest.period_start_to:type_name -> google.protobuf.Timestamp diff --git a/api/qan/v1/profile.swagger.json b/api/qan/v1/profile.swagger.json new file mode 100644 index 00000000000..d893a4c50f0 --- /dev/null +++ b/api/qan/v1/profile.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "qan/v1/profile.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/qan/v1/qan.pb.go b/api/qan/v1/qan.pb.go index 629cc7d94b5..8151058b8ea 100644 --- a/api/qan/v1/qan.pb.go +++ b/api/qan/v1/qan.pb.go @@ -7,12 +7,11 @@ package qanv1 import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -991,16 +990,13 @@ func file_qan_v1_qan_proto_rawDescGZIP() []byte { return file_qan_v1_qan_proto_rawDescData } -var ( - file_qan_v1_qan_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_qan_v1_qan_proto_msgTypes = make([]protoimpl.MessageInfo, 2) - file_qan_v1_qan_proto_goTypes = []any{ - (ExampleType)(0), // 0: qan.v1.ExampleType - (*Point)(nil), // 1: qan.v1.Point - (*MapFieldEntry)(nil), // 2: qan.v1.MapFieldEntry - } -) - +var file_qan_v1_qan_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_qan_v1_qan_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_qan_v1_qan_proto_goTypes = []any{ + (ExampleType)(0), // 0: qan.v1.ExampleType + (*Point)(nil), // 1: qan.v1.Point + (*MapFieldEntry)(nil), // 2: qan.v1.MapFieldEntry +} var file_qan_v1_qan_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/qan/v1/qan.swagger.json b/api/qan/v1/qan.swagger.json new file mode 100644 index 00000000000..eef59052f3e --- /dev/null +++ b/api/qan/v1/qan.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "qan/v1/qan.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/qan/v1/service.pb.go b/api/qan/v1/service.pb.go index 0e52423aa51..05c3c795339 100644 --- a/api/qan/v1/service.pb.go +++ b/api/qan/v1/service.pb.go @@ -7,14 +7,13 @@ package qanv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -228,37 +227,34 @@ func file_qan_v1_service_proto_rawDescGZIP() []byte { return file_qan_v1_service_proto_rawDescData } -var ( - file_qan_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5) - file_qan_v1_service_proto_goTypes = []any{ - (*GetMetricsNamesRequest)(nil), // 0: qan.v1.GetMetricsNamesRequest - (*GetMetricsNamesResponse)(nil), // 1: qan.v1.GetMetricsNamesResponse - (*HealthCheckRequest)(nil), // 2: qan.v1.HealthCheckRequest - (*HealthCheckResponse)(nil), // 3: qan.v1.HealthCheckResponse - nil, // 4: qan.v1.GetMetricsNamesResponse.DataEntry - (*GetReportRequest)(nil), // 5: qan.v1.GetReportRequest - (*GetFilteredMetricsNamesRequest)(nil), // 6: qan.v1.GetFilteredMetricsNamesRequest - (*GetMetricsRequest)(nil), // 7: qan.v1.GetMetricsRequest - (*GetLabelsRequest)(nil), // 8: qan.v1.GetLabelsRequest - (*GetHistogramRequest)(nil), // 9: qan.v1.GetHistogramRequest - (*ExplainFingerprintByQueryIDRequest)(nil), // 10: qan.v1.ExplainFingerprintByQueryIDRequest - (*GetQueryPlanRequest)(nil), // 11: qan.v1.GetQueryPlanRequest - (*QueryExistsRequest)(nil), // 12: qan.v1.QueryExistsRequest - (*SchemaByQueryIDRequest)(nil), // 13: qan.v1.SchemaByQueryIDRequest - (*GetQueryExampleRequest)(nil), // 14: qan.v1.GetQueryExampleRequest - (*GetReportResponse)(nil), // 15: qan.v1.GetReportResponse - (*GetFilteredMetricsNamesResponse)(nil), // 16: qan.v1.GetFilteredMetricsNamesResponse - (*GetMetricsResponse)(nil), // 17: qan.v1.GetMetricsResponse - (*GetLabelsResponse)(nil), // 18: qan.v1.GetLabelsResponse - (*GetHistogramResponse)(nil), // 19: qan.v1.GetHistogramResponse - (*ExplainFingerprintByQueryIDResponse)(nil), // 20: qan.v1.ExplainFingerprintByQueryIDResponse - (*GetQueryPlanResponse)(nil), // 21: qan.v1.GetQueryPlanResponse - (*QueryExistsResponse)(nil), // 22: qan.v1.QueryExistsResponse - (*SchemaByQueryIDResponse)(nil), // 23: qan.v1.SchemaByQueryIDResponse - (*GetQueryExampleResponse)(nil), // 24: qan.v1.GetQueryExampleResponse - } -) - +var file_qan_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_qan_v1_service_proto_goTypes = []any{ + (*GetMetricsNamesRequest)(nil), // 0: qan.v1.GetMetricsNamesRequest + (*GetMetricsNamesResponse)(nil), // 1: qan.v1.GetMetricsNamesResponse + (*HealthCheckRequest)(nil), // 2: qan.v1.HealthCheckRequest + (*HealthCheckResponse)(nil), // 3: qan.v1.HealthCheckResponse + nil, // 4: qan.v1.GetMetricsNamesResponse.DataEntry + (*GetReportRequest)(nil), // 5: qan.v1.GetReportRequest + (*GetFilteredMetricsNamesRequest)(nil), // 6: qan.v1.GetFilteredMetricsNamesRequest + (*GetMetricsRequest)(nil), // 7: qan.v1.GetMetricsRequest + (*GetLabelsRequest)(nil), // 8: qan.v1.GetLabelsRequest + (*GetHistogramRequest)(nil), // 9: qan.v1.GetHistogramRequest + (*ExplainFingerprintByQueryIDRequest)(nil), // 10: qan.v1.ExplainFingerprintByQueryIDRequest + (*GetQueryPlanRequest)(nil), // 11: qan.v1.GetQueryPlanRequest + (*QueryExistsRequest)(nil), // 12: qan.v1.QueryExistsRequest + (*SchemaByQueryIDRequest)(nil), // 13: qan.v1.SchemaByQueryIDRequest + (*GetQueryExampleRequest)(nil), // 14: qan.v1.GetQueryExampleRequest + (*GetReportResponse)(nil), // 15: qan.v1.GetReportResponse + (*GetFilteredMetricsNamesResponse)(nil), // 16: qan.v1.GetFilteredMetricsNamesResponse + (*GetMetricsResponse)(nil), // 17: qan.v1.GetMetricsResponse + (*GetLabelsResponse)(nil), // 18: qan.v1.GetLabelsResponse + (*GetHistogramResponse)(nil), // 19: qan.v1.GetHistogramResponse + (*ExplainFingerprintByQueryIDResponse)(nil), // 20: qan.v1.ExplainFingerprintByQueryIDResponse + (*GetQueryPlanResponse)(nil), // 21: qan.v1.GetQueryPlanResponse + (*QueryExistsResponse)(nil), // 22: qan.v1.QueryExistsResponse + (*SchemaByQueryIDResponse)(nil), // 23: qan.v1.SchemaByQueryIDResponse + (*GetQueryExampleResponse)(nil), // 24: qan.v1.GetQueryExampleResponse +} var file_qan_v1_service_proto_depIdxs = []int32{ 4, // 0: qan.v1.GetMetricsNamesResponse.data:type_name -> qan.v1.GetMetricsNamesResponse.DataEntry 5, // 1: qan.v1.QANService.GetReport:input_type -> qan.v1.GetReportRequest diff --git a/api/qan/v1/service.swagger.json b/api/qan/v1/service.swagger.json new file mode 100644 index 00000000000..d3b007a1e21 --- /dev/null +++ b/api/qan/v1/service.swagger.json @@ -0,0 +1,1568 @@ +{ + "swagger": "2.0", + "info": { + "title": "qan/v1/service.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "QANService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/qan/health": { + "get": { + "summary": "Health Check", + "description": "Returns readiness of QAN API2 service.", + "operationId": "HealthCheck", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1HealthCheckResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "QANService" + ] + } + }, + "/v1/qan/metrics:getFilters": { + "post": { + "summary": "Get Filters", + "description": "Provides a filtered map of metrics names.", + "operationId": "GetFilteredMetricsNames", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetFilteredMetricsNamesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "GetFilteredMetricsNamesRequest contains period for which we need filters.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetFilteredMetricsNamesRequest" + } + } + ], + "tags": [ + "QANService" + ] + } + }, + "/v1/qan/metrics:getNames": { + "post": { + "summary": "Get Metrics Names", + "description": "Provides a map of all metrics names.", + "operationId": "GetMetricsNames", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetMetricsNamesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "MetricsNamesRequest is empty.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetMetricsNamesRequest" + } + } + ], + "tags": [ + "QANService" + ] + } + }, + "/v1/qan/metrics:getReport": { + "post": { + "summary": "Get Report", + "description": "Returns a list of metrics grouped by queryid or other dimensions.", + "operationId": "GetReport", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetReportResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "ReportRequest defines filtering of metrics report for db server or other dimentions.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetReportRequest" + } + } + ], + "tags": [ + "QANService" + ] + } + }, + "/v1/qan/query/{queryid}/plan": { + "get": { + "summary": "Get Query Plan", + "description": "Provides a query plan and plan id for specific filtering.", + "operationId": "GetQueryPlan", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetQueryPlanResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "queryid", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "QANService" + ] + } + }, + "/v1/qan/query:exists": { + "post": { + "summary": "Check Query Existence", + "description": "Checks if query exists in clickhouse.", + "operationId": "QueryExists", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1QueryExistsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "QueryExistsRequest check if provided query exists or not.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1QueryExistsRequest" + } + } + ], + "tags": [ + "QANService" + ] + } + }, + "/v1/qan/query:getExample": { + "post": { + "summary": "Get Query Example", + "description": "Provides a list of query examples.", + "operationId": "GetQueryExample", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetQueryExampleResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "GetQueryExampleRequest defines filtering of query examples for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetQueryExampleRequest" + } + } + ], + "tags": [ + "QANService" + ] + } + }, + "/v1/qan/query:getSchema": { + "post": { + "summary": "Get Schema", + "description": "Provides the schema for a given queryID and serviceID.", + "operationId": "SchemaByQueryID", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SchemaByQueryIDResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SchemaByQueryIDRequest" + } + } + ], + "tags": [ + "QANService" + ] + } + }, + "/v1/qan:explainFingerprint": { + "post": { + "summary": "Get Explain Fingerprint", + "description": "Provides an explain fingerprint for given query ID.", + "operationId": "ExplainFingerprintByQueryID", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ExplainFingerprintByQueryIDResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ExplainFingerprintByQueryIDRequest" + } + } + ], + "tags": [ + "QANService" + ] + } + }, + "/v1/qan:getHistogram": { + "post": { + "summary": "Get Histogram", + "description": "Provides histogram items for specific filtering.", + "operationId": "GetHistogram", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetHistogramResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "GetHistogramRequest defines filtering by time range, labels and queryid.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetHistogramRequest" + } + } + ], + "tags": [ + "QANService" + ] + } + }, + "/v1/qan:getLabels": { + "post": { + "summary": "Get Labels", + "description": "Provides a list of labels for object details.", + "operationId": "GetLabels", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetLabelsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "GetLabelsRequest defines filtering of object detail's labels for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetLabelsRequest" + } + } + ], + "tags": [ + "QANService" + ] + } + }, + "/v1/qan:getMetrics": { + "post": { + "summary": "Get Metrics", + "description": "Provides a map of metrics for specific filtering.", + "operationId": "GetMetrics", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetMetricsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "GetMetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetMetricsRequest" + } + } + ], + "tags": [ + "QANService" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1ExampleType": { + "type": "string", + "enum": [ + "EXAMPLE_TYPE_UNSPECIFIED", + "EXAMPLE_TYPE_RANDOM", + "EXAMPLE_TYPE_SLOWEST", + "EXAMPLE_TYPE_FASTEST", + "EXAMPLE_TYPE_WITH_ERROR" + ], + "default": "EXAMPLE_TYPE_UNSPECIFIED", + "description": "ExampleType is a type of query example selected for this query class in given period of time." + }, + "v1ExplainFingerprintByQueryIDRequest": { + "type": "object", + "properties": { + "serviceid": { + "type": "string" + }, + "query_id": { + "type": "string" + } + }, + "description": "ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID." + }, + "v1ExplainFingerprintByQueryIDResponse": { + "type": "object", + "properties": { + "explain_fingerprint": { + "type": "string" + }, + "placeholders_count": { + "type": "integer", + "format": "int64" + } + }, + "description": "ExplainFingerprintByQueryIDResponse is explain fingerprint and placeholders count for given query ID." + }, + "v1GetFilteredMetricsNamesRequest": { + "type": "object", + "properties": { + "period_start_from": { + "type": "string", + "format": "date-time" + }, + "period_start_to": { + "type": "string", + "format": "date-time" + }, + "main_metric_name": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1MapFieldEntry" + } + } + }, + "description": "GetFilteredMetricsNamesRequest contains period for which we need filters." + }, + "v1GetFilteredMetricsNamesResponse": { + "type": "object", + "properties": { + "labels": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1ListLabels" + } + } + }, + "description": "GetFilteredMetricsNamesResponse is map of labels for given period by key.\nKey is label's name and value is label's value and how many times it occur." + }, + "v1GetHistogramRequest": { + "type": "object", + "properties": { + "period_start_from": { + "type": "string", + "format": "date-time" + }, + "period_start_to": { + "type": "string", + "format": "date-time" + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1MapFieldEntry" + } + }, + "queryid": { + "type": "string" + } + }, + "description": "GetHistogramRequest defines filtering by time range, labels and queryid." + }, + "v1GetHistogramResponse": { + "type": "object", + "properties": { + "histogram_items": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1HistogramItem" + } + } + }, + "description": "GetHistogramResponse is histogram items as a list." + }, + "v1GetLabelsRequest": { + "type": "object", + "properties": { + "period_start_from": { + "type": "string", + "format": "date-time" + }, + "period_start_to": { + "type": "string", + "format": "date-time" + }, + "filter_by": { + "type": "string", + "description": "dimension value: ex: queryid - 1D410B4BE5060972." + }, + "group_by": { + "type": "string", + "description": "one of dimension: queryid | host ..." + } + }, + "description": "GetLabelsRequest defines filtering of object detail's labels for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972." + }, + "v1GetLabelsResponse": { + "type": "object", + "properties": { + "labels": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1ListLabelValues" + } + } + }, + "description": "GetLabelsResponse is a map of labels names as keys and labels values as a list." + }, + "v1GetMetricsNamesRequest": { + "type": "object", + "description": "MetricsNamesRequest is empty." + }, + "v1GetMetricsNamesResponse": { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "MetricsNamesReply is map of stored metrics:\nkey is root of metric name in db (Ex:. [m_]query_time[_sum]);\nvalue - Human readable name of metrics." + }, + "v1GetMetricsRequest": { + "type": "object", + "properties": { + "period_start_from": { + "type": "string", + "format": "date-time" + }, + "period_start_to": { + "type": "string", + "format": "date-time" + }, + "filter_by": { + "type": "string", + "description": "dimension value: ex: queryid - 1D410B4BE5060972." + }, + "group_by": { + "type": "string", + "description": "one of dimension: queryid | host ..." + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1MapFieldEntry" + } + }, + "include_only_fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "totals": { + "type": "boolean", + "title": "retrieve only values for totals, excluding N/A values" + } + }, + "description": "GetMetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972." + }, + "v1GetMetricsResponse": { + "type": "object", + "properties": { + "metrics": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1MetricValues" + } + }, + "text_metrics": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "sparkline": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Point" + } + }, + "totals": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1MetricValues" + } + }, + "fingerprint": { + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/v1GetSelectedQueryMetadataResponse" + } + }, + "description": "GetMetricsResponse defines metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972." + }, + "v1GetQueryExampleRequest": { + "type": "object", + "properties": { + "period_start_from": { + "type": "string", + "format": "date-time" + }, + "period_start_to": { + "type": "string", + "format": "date-time" + }, + "filter_by": { + "type": "string", + "description": "dimension value: ex: queryid - 1D410B4BE5060972." + }, + "group_by": { + "type": "string", + "description": "one of dimension: queryid | host ..." + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1MapFieldEntry" + } + }, + "limit": { + "type": "integer", + "format": "int64" + } + }, + "description": "GetQueryExampleRequest defines filtering of query examples for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972." + }, + "v1GetQueryExampleResponse": { + "type": "object", + "properties": { + "query_examples": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1QueryExample" + } + } + }, + "description": "GetQueryExampleResponse list of query examples." + }, + "v1GetQueryPlanResponse": { + "type": "object", + "properties": { + "planid": { + "type": "string" + }, + "query_plan": { + "type": "string" + } + }, + "description": "GetQueryPlanResponse contains planid and query_plan." + }, + "v1GetReportRequest": { + "type": "object", + "properties": { + "period_start_from": { + "type": "string", + "format": "date-time" + }, + "period_start_to": { + "type": "string", + "format": "date-time" + }, + "group_by": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ReportMapFieldEntry" + } + }, + "columns": { + "type": "array", + "items": { + "type": "string" + } + }, + "order_by": { + "type": "string" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "integer", + "format": "int64" + }, + "main_metric": { + "type": "string" + }, + "search": { + "type": "string" + } + }, + "description": "ReportRequest defines filtering of metrics report for db server or other dimentions." + }, + "v1GetReportResponse": { + "type": "object", + "properties": { + "total_rows": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "integer", + "format": "int64" + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Row" + } + } + }, + "description": "ReportReply is list of reports per quieryids, hosts etc." + }, + "v1GetSelectedQueryMetadataResponse": { + "type": "object", + "properties": { + "service_name": { + "type": "string" + }, + "database": { + "type": "string" + }, + "schema": { + "type": "string" + }, + "username": { + "type": "string" + }, + "replication_set": { + "type": "string" + }, + "cluster": { + "type": "string" + }, + "service_type": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "environment": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "node_name": { + "type": "string" + }, + "node_type": { + "type": "string" + } + }, + "description": "GetSlecetedQueryMetadataResponse consists selected query metadata to show in details for given query ID." + }, + "v1HealthCheckResponse": { + "type": "object", + "description": "HealthCheckResponse is empty, based on returned error qan-api2 is ready or not." + }, + "v1HistogramItem": { + "type": "object", + "properties": { + "range": { + "type": "string" + }, + "frequency": { + "type": "integer", + "format": "int64" + } + }, + "description": "HistogramItem represents one item in histogram." + }, + "v1ListLabelValues": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "ListLabelValues is list of label's values." + }, + "v1ListLabels": { + "type": "object", + "properties": { + "name": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Values" + } + } + }, + "description": "ListLabels is list of label's values: duplicates are impossible." + }, + "v1MapFieldEntry": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}." + }, + "v1Metric": { + "type": "object", + "properties": { + "stats": { + "$ref": "#/definitions/v1Stat" + } + }, + "description": "Metric cell." + }, + "v1MetricValues": { + "type": "object", + "properties": { + "rate": { + "type": "number", + "format": "float" + }, + "cnt": { + "type": "number", + "format": "float" + }, + "sum": { + "type": "number", + "format": "float" + }, + "min": { + "type": "number", + "format": "float" + }, + "max": { + "type": "number", + "format": "float" + }, + "avg": { + "type": "number", + "format": "float" + }, + "p99": { + "type": "number", + "format": "float" + }, + "percent_of_total": { + "type": "number", + "format": "float" + } + }, + "description": "MetricValues is statistics of specific metric." + }, + "v1Point": { + "type": "object", + "properties": { + "point": { + "type": "integer", + "format": "int64", + "description": "The serial number of the chart point from the largest time in the time interval to the lowest time in the time range." + }, + "time_frame": { + "type": "integer", + "format": "int64", + "description": "Duration beetween two points." + }, + "timestamp": { + "type": "string", + "description": "Time of point in format RFC3339." + }, + "load": { + "type": "number", + "format": "float", + "description": "load is query_time / time_range." + }, + "num_queries_per_sec": { + "type": "number", + "format": "float", + "description": "number of queries in bucket." + }, + "num_queries_with_errors_per_sec": { + "type": "number", + "format": "float", + "description": "number of queries with errors." + }, + "num_queries_with_warnings_per_sec": { + "type": "number", + "format": "float", + "description": "number of queries with warnings." + }, + "m_query_time_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The statement execution time in seconds." + }, + "m_lock_time_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The time to acquire locks in seconds." + }, + "m_rows_sent_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of rows sent to the client." + }, + "m_rows_examined_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Number of rows scanned - SELECT." + }, + "m_rows_affected_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Number of rows changed - UPDATE, DELETE, INSERT." + }, + "m_rows_read_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of rows read from tables." + }, + "m_merge_passes_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of merge passes that the sort algorithm has had to do." + }, + "m_innodb_io_r_ops_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Counts the number of page read operations scheduled." + }, + "m_innodb_io_r_bytes_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Similar to innodb_IO_r_ops, but the unit is bytes." + }, + "m_innodb_io_r_wait_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Shows how long (in seconds) it took InnoDB to actually read the data from storage." + }, + "m_innodb_rec_lock_wait_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Shows how long (in seconds) the query waited for row locks." + }, + "m_innodb_queue_wait_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution." + }, + "m_innodb_pages_distinct_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Counts approximately the number of unique pages the query accessed." + }, + "m_query_length_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Shows how long the query is." + }, + "m_bytes_sent_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of bytes sent to all clients." + }, + "m_tmp_tables_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Number of temporary tables created on memory for the query." + }, + "m_tmp_disk_tables_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Number of temporary tables created on disk for the query." + }, + "m_tmp_table_sizes_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total Size in bytes for all temporary tables used in the query." + }, + "m_qc_hit_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Query Cache hits." + }, + "m_full_scan_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The query performed a full table scan." + }, + "m_full_join_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The query performed a full join (a join without indexes)." + }, + "m_tmp_table_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The query created an implicit internal temporary table." + }, + "m_tmp_table_on_disk_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The querys temporary table was stored on disk." + }, + "m_filesort_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The query used a filesort." + }, + "m_filesort_on_disk_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The filesort was performed on disk." + }, + "m_select_full_range_join_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of joins that used a range search on a reference table." + }, + "m_select_range_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of joins that used ranges on the first table." + }, + "m_select_range_check_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of joins without keys that check for key usage after each row." + }, + "m_sort_range_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of sorts that were done using ranges." + }, + "m_sort_rows_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of sorted rows." + }, + "m_sort_scan_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of sorts that were done by scanning the table." + }, + "m_no_index_used_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of queries without index." + }, + "m_no_good_index_used_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of queries without good index." + }, + "m_docs_returned_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of returned documents." + }, + "m_response_length_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The response length of the query result in bytes." + }, + "m_docs_scanned_sum_per_sec": { + "type": "number", + "format": "float", + "description": "The number of scanned documents." + }, + "m_docs_examined_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of documents scanned during query execution." + }, + "m_keys_examined_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of index keys scanned during query execution." + }, + "m_locks_global_acquire_count_read_shared_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Number of times a global read lock was acquired during query execution." + }, + "m_locks_global_acquire_count_write_shared_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Number of times a global write lock was acquired during query execution." + }, + "m_locks_database_acquire_count_read_shared_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Number of times a read lock was acquired at the database level during query execution." + }, + "m_locks_database_acquire_wait_count_read_shared_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Number of times a read lock at the database level was requested but had to wait before being granted." + }, + "m_locks_database_time_acquiring_micros_read_shared_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Indicates the time, spent acquiring a read lock at the database level during an operation." + }, + "m_locks_collection_acquire_count_read_shared_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Number of times a read lock was acquired on a specific collection during operations." + }, + "m_storage_bytes_read_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of bytes read from storage during a specific operation." + }, + "m_storage_time_reading_micros_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Indicates the time, spent reading data from storage during an operation." + }, + "m_shared_blks_hit_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of shared block cache hits by the statement." + }, + "m_shared_blks_read_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of shared blocks read by the statement." + }, + "m_shared_blks_dirtied_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of shared blocks dirtied by the statement." + }, + "m_shared_blks_written_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of shared blocks written by the statement." + }, + "m_shared_blk_read_time_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)." + }, + "m_shared_blk_write_time_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)." + }, + "m_local_blk_read_time_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)." + }, + "m_local_blk_write_time_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)." + }, + "m_local_blks_hit_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of local block cache hits by the statement." + }, + "m_local_blks_read_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of local blocks read by the statement." + }, + "m_local_blks_dirtied_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of local blocks dirtied by the statement." + }, + "m_local_blks_written_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of local blocks written by the statement." + }, + "m_temp_blks_read_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of temp blocks read by the statement." + }, + "m_temp_blks_written_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of temp blocks written by the statement." + }, + "m_blk_read_time_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)." + }, + "m_blk_write_time_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)." + }, + "m_cpu_user_time_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total time user spent in query." + }, + "m_cpu_sys_time_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total time system spent in query." + }, + "m_plans_calls_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of planned calls." + }, + "m_wal_records_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of WAL (Write-ahead logging) records." + }, + "m_wal_fpi_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of FPI (full page images) in WAL (Write-ahead logging) records." + }, + "m_wal_bytes_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total bytes of WAL (Write-ahead logging) records." + }, + "m_wal_buffers_full_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of times WAL buffers become full." + }, + "m_parallel_workers_to_launch_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of parallel workers to launch." + }, + "m_parallel_workers_launched_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Total number of parallel workers launched." + }, + "m_plan_time_sum_per_sec": { + "type": "number", + "format": "float", + "description": "Plan time in per seconds." + } + }, + "description": "Point contains values that represents abscissa (time) and ordinate (volume etc.)\nof every point in a coordinate system of Sparklines." + }, + "v1QueryExample": { + "type": "object", + "properties": { + "example": { + "type": "string" + }, + "example_type": { + "$ref": "#/definitions/v1ExampleType" + }, + "is_truncated": { + "type": "integer", + "format": "int64" + }, + "placeholders_count": { + "type": "integer", + "format": "int64" + }, + "explain_fingerprint": { + "type": "string" + }, + "query_id": { + "type": "string" + }, + "example_metrics": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "service_type": { + "type": "string" + }, + "schema": { + "type": "string" + }, + "tables": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "QueryExample shows query examples and their metrics." + }, + "v1QueryExistsRequest": { + "type": "object", + "properties": { + "serviceid": { + "type": "string" + }, + "query": { + "type": "string" + } + }, + "description": "QueryExistsRequest check if provided query exists or not." + }, + "v1QueryExistsResponse": { + "type": "object", + "properties": { + "exists": { + "type": "boolean" + } + }, + "description": "QueryExistsResponse returns true if query exists." + }, + "v1ReportMapFieldEntry": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "ReportMapFieldEntry allows to pass labels/dimentions in form like {\"server\": [\"db1\", \"db2\"...]}." + }, + "v1Row": { + "type": "object", + "properties": { + "rank": { + "type": "integer", + "format": "int64" + }, + "dimension": { + "type": "string" + }, + "database": { + "type": "string" + }, + "metrics": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1Metric" + } + }, + "sparkline": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Point" + } + }, + "fingerprint": { + "type": "string" + }, + "num_queries": { + "type": "integer", + "format": "int64" + }, + "qps": { + "type": "number", + "format": "float" + }, + "load": { + "type": "number", + "format": "float" + } + }, + "description": "Row define metrics for selected dimention." + }, + "v1SchemaByQueryIDRequest": { + "type": "object", + "properties": { + "service_id": { + "type": "string" + }, + "query_id": { + "type": "string" + } + }, + "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID." + }, + "v1SchemaByQueryIDResponse": { + "type": "object", + "properties": { + "schema": { + "type": "string" + } + }, + "description": "SchemaByQueryIDResponse is schema for given query ID and service ID." + }, + "v1Stat": { + "type": "object", + "properties": { + "rate": { + "type": "number", + "format": "float" + }, + "cnt": { + "type": "number", + "format": "float" + }, + "sum": { + "type": "number", + "format": "float" + }, + "min": { + "type": "number", + "format": "float" + }, + "max": { + "type": "number", + "format": "float" + }, + "p99": { + "type": "number", + "format": "float" + }, + "avg": { + "type": "number", + "format": "float" + }, + "sum_per_sec": { + "type": "number", + "format": "float" + } + }, + "description": "Stat is statistics of specific metric." + }, + "v1Values": { + "type": "object", + "properties": { + "value": { + "type": "string" + }, + "main_metric_percent": { + "type": "number", + "format": "float" + }, + "main_metric_per_sec": { + "type": "number", + "format": "float" + } + }, + "description": "Values is label values and main metric percent and per second." + } + } +} diff --git a/api/qan/v1/service_grpc.pb.go b/api/qan/v1/service_grpc.pb.go index d96a6d9d45c..752a91653a0 100644 --- a/api/qan/v1/service_grpc.pb.go +++ b/api/qan/v1/service_grpc.pb.go @@ -8,7 +8,6 @@ package qanv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -237,47 +236,36 @@ type UnimplementedQANServiceServer struct{} func (UnimplementedQANServiceServer) GetReport(context.Context, *GetReportRequest) (*GetReportResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetReport not implemented") } - func (UnimplementedQANServiceServer) GetFilteredMetricsNames(context.Context, *GetFilteredMetricsNamesRequest) (*GetFilteredMetricsNamesResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetFilteredMetricsNames not implemented") } - func (UnimplementedQANServiceServer) GetMetricsNames(context.Context, *GetMetricsNamesRequest) (*GetMetricsNamesResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetMetricsNames not implemented") } - func (UnimplementedQANServiceServer) GetMetrics(context.Context, *GetMetricsRequest) (*GetMetricsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetMetrics not implemented") } - func (UnimplementedQANServiceServer) GetLabels(context.Context, *GetLabelsRequest) (*GetLabelsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetLabels not implemented") } - func (UnimplementedQANServiceServer) GetHistogram(context.Context, *GetHistogramRequest) (*GetHistogramResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetHistogram not implemented") } - func (UnimplementedQANServiceServer) ExplainFingerprintByQueryID(context.Context, *ExplainFingerprintByQueryIDRequest) (*ExplainFingerprintByQueryIDResponse, error) { return nil, status.Error(codes.Unimplemented, "method ExplainFingerprintByQueryID not implemented") } - func (UnimplementedQANServiceServer) GetQueryPlan(context.Context, *GetQueryPlanRequest) (*GetQueryPlanResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetQueryPlan not implemented") } - func (UnimplementedQANServiceServer) QueryExists(context.Context, *QueryExistsRequest) (*QueryExistsResponse, error) { return nil, status.Error(codes.Unimplemented, "method QueryExists not implemented") } - func (UnimplementedQANServiceServer) SchemaByQueryID(context.Context, *SchemaByQueryIDRequest) (*SchemaByQueryIDResponse, error) { return nil, status.Error(codes.Unimplemented, "method SchemaByQueryID not implemented") } - func (UnimplementedQANServiceServer) GetQueryExample(context.Context, *GetQueryExampleRequest) (*GetQueryExampleResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetQueryExample not implemented") } - func (UnimplementedQANServiceServer) HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { return nil, status.Error(codes.Unimplemented, "method HealthCheck not implemented") } diff --git a/api/realtimeanalytics/v1/collector.pb.go b/api/realtimeanalytics/v1/collector.pb.go index f149de0a6cf..8bb47bf7612 100644 --- a/api/realtimeanalytics/v1/collector.pb.go +++ b/api/realtimeanalytics/v1/collector.pb.go @@ -7,13 +7,12 @@ package realtimeanalyticsv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "google.golang.org/genproto/googleapis/api/visibility" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -132,15 +131,12 @@ func file_realtimeanalytics_v1_collector_proto_rawDescGZIP() []byte { return file_realtimeanalytics_v1_collector_proto_rawDescData } -var ( - file_realtimeanalytics_v1_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 2) - file_realtimeanalytics_v1_collector_proto_goTypes = []any{ - (*CollectRequest)(nil), // 0: realtimeanalytics.v1.CollectRequest - (*CollectResponse)(nil), // 1: realtimeanalytics.v1.CollectResponse - (*QueryData)(nil), // 2: realtimeanalytics.v1.QueryData - } -) - +var file_realtimeanalytics_v1_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_realtimeanalytics_v1_collector_proto_goTypes = []any{ + (*CollectRequest)(nil), // 0: realtimeanalytics.v1.CollectRequest + (*CollectResponse)(nil), // 1: realtimeanalytics.v1.CollectResponse + (*QueryData)(nil), // 2: realtimeanalytics.v1.QueryData +} var file_realtimeanalytics_v1_collector_proto_depIdxs = []int32{ 2, // 0: realtimeanalytics.v1.CollectRequest.queries:type_name -> realtimeanalytics.v1.QueryData 0, // 1: realtimeanalytics.v1.CollectorService.Collect:input_type -> realtimeanalytics.v1.CollectRequest diff --git a/api/realtimeanalytics/v1/collector.swagger.json b/api/realtimeanalytics/v1/collector.swagger.json new file mode 100644 index 00000000000..0216a29e22a --- /dev/null +++ b/api/realtimeanalytics/v1/collector.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "realtimeanalytics/v1/collector.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/realtimeanalytics/v1/collector_grpc.pb.go b/api/realtimeanalytics/v1/collector_grpc.pb.go index 738bc9985e9..7bd50b8144c 100644 --- a/api/realtimeanalytics/v1/collector_grpc.pb.go +++ b/api/realtimeanalytics/v1/collector_grpc.pb.go @@ -8,7 +8,6 @@ package realtimeanalyticsv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/realtimeanalytics/v1/query.pb.go b/api/realtimeanalytics/v1/query.pb.go index 6d3f2df71da..d2c537c1744 100644 --- a/api/realtimeanalytics/v1/query.pb.go +++ b/api/realtimeanalytics/v1/query.pb.go @@ -7,14 +7,13 @@ package realtimeanalyticsv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -320,16 +319,13 @@ func file_realtimeanalytics_v1_query_proto_rawDescGZIP() []byte { return file_realtimeanalytics_v1_query_proto_rawDescData } -var ( - file_realtimeanalytics_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) - file_realtimeanalytics_v1_query_proto_goTypes = []any{ - (*QueryMongoDBData)(nil), // 0: realtimeanalytics.v1.QueryMongoDBData - (*QueryData)(nil), // 1: realtimeanalytics.v1.QueryData - (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 3: google.protobuf.Duration - } -) - +var file_realtimeanalytics_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_realtimeanalytics_v1_query_proto_goTypes = []any{ + (*QueryMongoDBData)(nil), // 0: realtimeanalytics.v1.QueryMongoDBData + (*QueryData)(nil), // 1: realtimeanalytics.v1.QueryData + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 3: google.protobuf.Duration +} var file_realtimeanalytics_v1_query_proto_depIdxs = []int32{ 2, // 0: realtimeanalytics.v1.QueryMongoDBData.operation_start_time:type_name -> google.protobuf.Timestamp 3, // 1: realtimeanalytics.v1.QueryData.query_execution_duration:type_name -> google.protobuf.Duration diff --git a/api/realtimeanalytics/v1/query.swagger.json b/api/realtimeanalytics/v1/query.swagger.json new file mode 100644 index 00000000000..6a628f444b1 --- /dev/null +++ b/api/realtimeanalytics/v1/query.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "realtimeanalytics/v1/query.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/realtimeanalytics/v1/realtimeanalytics.pb.go b/api/realtimeanalytics/v1/realtimeanalytics.pb.go index 9aaf7797747..1d1b609979f 100644 --- a/api/realtimeanalytics/v1/realtimeanalytics.pb.go +++ b/api/realtimeanalytics/v1/realtimeanalytics.pb.go @@ -7,19 +7,17 @@ package realtimeanalyticsv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + v1 "github.com/percona/pmm/api/inventory/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -695,30 +693,27 @@ func file_realtimeanalytics_v1_realtimeanalytics_proto_rawDescGZIP() []byte { return file_realtimeanalytics_v1_realtimeanalytics_proto_rawDescData } -var ( - file_realtimeanalytics_v1_realtimeanalytics_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_realtimeanalytics_v1_realtimeanalytics_proto_msgTypes = make([]protoimpl.MessageInfo, 11) - file_realtimeanalytics_v1_realtimeanalytics_proto_goTypes = []any{ - (SessionStatus)(0), // 0: realtimeanalytics.v1.SessionStatus - (*ListServicesRequest)(nil), // 1: realtimeanalytics.v1.ListServicesRequest - (*ListServicesResponse)(nil), // 2: realtimeanalytics.v1.ListServicesResponse - (*Session)(nil), // 3: realtimeanalytics.v1.Session - (*ListSessionsRequest)(nil), // 4: realtimeanalytics.v1.ListSessionsRequest - (*ListSessionsResponse)(nil), // 5: realtimeanalytics.v1.ListSessionsResponse - (*StartSessionRequest)(nil), // 6: realtimeanalytics.v1.StartSessionRequest - (*StartSessionResponse)(nil), // 7: realtimeanalytics.v1.StartSessionResponse - (*StopSessionRequest)(nil), // 8: realtimeanalytics.v1.StopSessionRequest - (*StopSessionResponse)(nil), // 9: realtimeanalytics.v1.StopSessionResponse - (*SearchQueriesRequest)(nil), // 10: realtimeanalytics.v1.SearchQueriesRequest - (*SearchQueriesResponse)(nil), // 11: realtimeanalytics.v1.SearchQueriesResponse - (v1.ServiceType)(0), // 12: inventory.v1.ServiceType - (*v1.MongoDBService)(nil), // 13: inventory.v1.MongoDBService - (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 15: google.protobuf.Duration - (*QueryData)(nil), // 16: realtimeanalytics.v1.QueryData - } -) - +var file_realtimeanalytics_v1_realtimeanalytics_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_realtimeanalytics_v1_realtimeanalytics_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_realtimeanalytics_v1_realtimeanalytics_proto_goTypes = []any{ + (SessionStatus)(0), // 0: realtimeanalytics.v1.SessionStatus + (*ListServicesRequest)(nil), // 1: realtimeanalytics.v1.ListServicesRequest + (*ListServicesResponse)(nil), // 2: realtimeanalytics.v1.ListServicesResponse + (*Session)(nil), // 3: realtimeanalytics.v1.Session + (*ListSessionsRequest)(nil), // 4: realtimeanalytics.v1.ListSessionsRequest + (*ListSessionsResponse)(nil), // 5: realtimeanalytics.v1.ListSessionsResponse + (*StartSessionRequest)(nil), // 6: realtimeanalytics.v1.StartSessionRequest + (*StartSessionResponse)(nil), // 7: realtimeanalytics.v1.StartSessionResponse + (*StopSessionRequest)(nil), // 8: realtimeanalytics.v1.StopSessionRequest + (*StopSessionResponse)(nil), // 9: realtimeanalytics.v1.StopSessionResponse + (*SearchQueriesRequest)(nil), // 10: realtimeanalytics.v1.SearchQueriesRequest + (*SearchQueriesResponse)(nil), // 11: realtimeanalytics.v1.SearchQueriesResponse + (v1.ServiceType)(0), // 12: inventory.v1.ServiceType + (*v1.MongoDBService)(nil), // 13: inventory.v1.MongoDBService + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 15: google.protobuf.Duration + (*QueryData)(nil), // 16: realtimeanalytics.v1.QueryData +} var file_realtimeanalytics_v1_realtimeanalytics_proto_depIdxs = []int32{ 12, // 0: realtimeanalytics.v1.ListServicesRequest.service_type:type_name -> inventory.v1.ServiceType 13, // 1: realtimeanalytics.v1.ListServicesResponse.mongodb:type_name -> inventory.v1.MongoDBService diff --git a/api/realtimeanalytics/v1/realtimeanalytics.swagger.json b/api/realtimeanalytics/v1/realtimeanalytics.swagger.json new file mode 100644 index 00000000000..59d45b36d7a --- /dev/null +++ b/api/realtimeanalytics/v1/realtimeanalytics.swagger.json @@ -0,0 +1,516 @@ +{ + "swagger": "2.0", + "info": { + "title": "realtimeanalytics/v1/realtimeanalytics.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "RealtimeAnalyticsService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/realtimeanalytics/queries:search": { + "post": { + "summary": "List Running Database Queries in a particular services", + "description": "Returns list of currently running Database queries in a particular services", + "operationId": "SearchQueries", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SearchQueriesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "SearchQueriesRequest contains optional filters for listing active Real-Time Analytics session Queries.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SearchQueriesRequest" + } + } + ], + "tags": [ + "RealtimeAnalyticsService" + ] + } + }, + "/v1/realtimeanalytics/services": { + "get": { + "summary": "List Services that support Real-Time Analytics", + "description": "Returns a list of Services that support Real-Time Analytics filtered by type.", + "operationId": "ListServices", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListServicesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "service_type", + "description": "Return only services filtered by service type.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "SERVICE_TYPE_UNSPECIFIED", + "SERVICE_TYPE_MYSQL_SERVICE", + "SERVICE_TYPE_MONGODB_SERVICE", + "SERVICE_TYPE_POSTGRESQL_SERVICE", + "SERVICE_TYPE_VALKEY_SERVICE", + "SERVICE_TYPE_PROXYSQL_SERVICE", + "SERVICE_TYPE_HAPROXY_SERVICE", + "SERVICE_TYPE_EXTERNAL_SERVICE" + ], + "default": "SERVICE_TYPE_UNSPECIFIED" + } + ], + "tags": [ + "RealtimeAnalyticsService" + ] + } + }, + "/v1/realtimeanalytics/sessions": { + "get": { + "summary": "List Running Real-Time Analytics Sessions", + "description": "Returns the list of all currently running Real-Time Analytics sessions with their details including service, cluster and status information.", + "operationId": "ListSessions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListSessionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "cluster_name", + "description": "Optional filter by cluster name.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "RealtimeAnalyticsService" + ] + } + }, + "/v1/realtimeanalytics/sessions:start": { + "post": { + "summary": "Start Real-Time Analytics session", + "description": "Start Real-Time Analytics session for a specified service.", + "operationId": "StartSession", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StartSessionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "StartSessionRequest contains parameters for starting Real-Time Analytics session.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1StartSessionRequest" + } + } + ], + "tags": [ + "RealtimeAnalyticsService" + ] + } + }, + "/v1/realtimeanalytics/sessions:stop": { + "post": { + "summary": "Stop Real-Time Analytics session", + "description": "Stop Real-Time Analytics session for a specified service.", + "operationId": "StopSession", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StopSessionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "StopSessionRequest contains parameters for stopping Real-Time Analytics session.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1StopSessionRequest" + } + } + ], + "tags": [ + "RealtimeAnalyticsService" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1ListServicesResponse": { + "type": "object", + "properties": { + "mongodb": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1MongoDBService" + } + } + } + }, + "v1ListSessionsResponse": { + "type": "object", + "properties": { + "sessions": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Session" + }, + "description": "List of active Real-Time Analytics Sessions." + } + }, + "description": "ListSessionsResponse returns the list of currently active Real-Time Analytics Sessions." + }, + "v1MongoDBService": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Unique randomly generated instance identifier." + }, + "service_name": { + "type": "string", + "description": "Unique across all Services user-defined name." + }, + "node_id": { + "type": "string", + "description": "Node identifier where this instance runs." + }, + "address": { + "type": "string", + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "Access port.\nPort is required when the address present." + }, + "socket": { + "type": "string", + "description": "Access unix socket.\nAddress (and port) or socket is required." + }, + "environment": { + "type": "string", + "description": "Environment name." + }, + "cluster": { + "type": "string", + "description": "Cluster name." + }, + "replication_set": { + "type": "string", + "description": "Replication set name." + }, + "custom_labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom user-assigned labels." + }, + "version": { + "type": "string", + "description": "MongoDB version." + } + }, + "description": "MongoDBService represents a generic MongoDB instance." + }, + "v1QueryData": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "PMM Service identifier that reported the query." + }, + "service_name": { + "type": "string", + "description": "PMM Service name that reported the query." + }, + "query_id": { + "type": "string", + "description": "Unique identifier for the query." + }, + "query_text": { + "type": "string", + "description": "The text of the query." + }, + "query_raw_json": { + "type": "string", + "description": "Raw JSON representation of the query." + }, + "query_execution_duration": { + "type": "string", + "description": "Current query current execution time." + }, + "query_collect_time": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the query data was collected by Real-Time Analytics agent." + }, + "client_address": { + "type": "string", + "description": "Client address (host:port)." + }, + "mongo_db_payload": { + "$ref": "#/definitions/v1QueryMongoDBData", + "description": "MongoDB-specific query data." + } + }, + "description": "QueryData represents a single Real-Time Analytics query data point.\nIt includes general query information and a payload for database-specific details." + }, + "v1QueryMongoDBData": { + "type": "object", + "properties": { + "db_instance_address": { + "type": "string", + "description": "MongoDB instance address(host:port) that processing the query." + }, + "client_app_name": { + "type": "string", + "description": "Client application name from the MongoDB query." + }, + "database_name": { + "type": "string", + "description": "Database name." + }, + "collection": { + "type": "string", + "description": "Collection name." + }, + "operation": { + "type": "string", + "description": "Query operation (\"find\", \"aggregate\", \"update\", etc)." + }, + "operation_start_time": { + "type": "string", + "format": "date-time", + "description": "The start time of the operation." + }, + "username": { + "type": "string", + "description": "MongoDB user name associated with the query." + }, + "plan_summary": { + "type": "string", + "description": "Indicates if an index (COLLSCAN vs IXSCAN) was utilized in the query." + } + }, + "description": "QueryMongoDBData holds MongoDB-specific Real-Time Analytics query information." + }, + "v1SearchQueriesRequest": { + "type": "object", + "properties": { + "service_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional filter by Service identifiers." + }, + "limit": { + "type": "string", + "format": "int64", + "description": "Optional limit the number of queries in response." + } + }, + "description": "SearchQueriesRequest contains optional filters for listing active Real-Time Analytics session Queries." + }, + "v1SearchQueriesResponse": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1QueryData" + }, + "description": "List of active Real-Time Analytics session Queries." + } + }, + "description": "SearchQueriesResponse returns the list of currently active Real-Time Analytics session Queries." + }, + "v1ServiceType": { + "type": "string", + "enum": [ + "SERVICE_TYPE_UNSPECIFIED", + "SERVICE_TYPE_MYSQL_SERVICE", + "SERVICE_TYPE_MONGODB_SERVICE", + "SERVICE_TYPE_POSTGRESQL_SERVICE", + "SERVICE_TYPE_VALKEY_SERVICE", + "SERVICE_TYPE_PROXYSQL_SERVICE", + "SERVICE_TYPE_HAPROXY_SERVICE", + "SERVICE_TYPE_EXTERNAL_SERVICE" + ], + "default": "SERVICE_TYPE_UNSPECIFIED", + "description": "ServiceType describes supported Service types." + }, + "v1Session": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Service identifier that has enabled Real-Time Analytics session." + }, + "service_name": { + "type": "string", + "description": "Service name." + }, + "cluster_name": { + "type": "string", + "description": "Cluster name the service belongs to." + }, + "start_time": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the Real-Time Analytics session started." + }, + "collect_interval": { + "type": "string", + "description": "Query collect interval." + }, + "status": { + "$ref": "#/definitions/v1SessionStatus", + "description": "Current status of the Real-Time Analytics session." + } + }, + "description": "Session represents an active Real-Time Analytics session." + }, + "v1SessionStatus": { + "type": "string", + "enum": [ + "SESSION_STATUS_UNSPECIFIED", + "SESSION_STATUS_ERROR", + "SESSION_STATUS_RUNNING", + "SESSION_STATUS_DOWN" + ], + "default": "SESSION_STATUS_UNSPECIFIED", + "description": "Status represents actual Real-Time Analytics session status.\n\n - SESSION_STATUS_ERROR: Session encountered an error.\n - SESSION_STATUS_RUNNING: Session is running.\n - SESSION_STATUS_DOWN: Session has been stopped or disabled." + }, + "v1StartSessionRequest": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Required service identifier the Real-Time Analytics session shall be started for." + } + }, + "description": "StartSessionRequest contains parameters for starting Real-Time Analytics session." + }, + "v1StartSessionResponse": { + "type": "object", + "properties": { + "session": { + "$ref": "#/definitions/v1Session" + } + }, + "description": "StartSessionResponse is the response for starting Real-Time Analytics session." + }, + "v1StopSessionRequest": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "description": "Required service identifier the Real-Time Analytics session shall be stopped for." + } + }, + "description": "StopSessionRequest contains parameters for stopping Real-Time Analytics session." + }, + "v1StopSessionResponse": { + "type": "object", + "description": "StopSessionResponse is the response for stopping Real-Time Analytics session.\n\nEmpty response for now." + } + } +} diff --git a/api/realtimeanalytics/v1/realtimeanalytics_grpc.pb.go b/api/realtimeanalytics/v1/realtimeanalytics_grpc.pb.go index 0d389f33d03..730891f4d8d 100644 --- a/api/realtimeanalytics/v1/realtimeanalytics_grpc.pb.go +++ b/api/realtimeanalytics/v1/realtimeanalytics_grpc.pb.go @@ -8,7 +8,6 @@ package realtimeanalyticsv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -132,23 +131,18 @@ type UnimplementedRealtimeAnalyticsServiceServer struct{} func (UnimplementedRealtimeAnalyticsServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListServices not implemented") } - func (UnimplementedRealtimeAnalyticsServiceServer) ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListSessions not implemented") } - func (UnimplementedRealtimeAnalyticsServiceServer) StartSession(context.Context, *StartSessionRequest) (*StartSessionResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartSession not implemented") } - func (UnimplementedRealtimeAnalyticsServiceServer) StopSession(context.Context, *StopSessionRequest) (*StopSessionResponse, error) { return nil, status.Error(codes.Unimplemented, "method StopSession not implemented") } - func (UnimplementedRealtimeAnalyticsServiceServer) SearchQueries(context.Context, *SearchQueriesRequest) (*SearchQueriesResponse, error) { return nil, status.Error(codes.Unimplemented, "method SearchQueries not implemented") } - func (UnimplementedRealtimeAnalyticsServiceServer) mustEmbedUnimplementedRealtimeAnalyticsServiceServer() { } func (UnimplementedRealtimeAnalyticsServiceServer) testEmbeddedByValue() {} diff --git a/api/server/v1/httperror.pb.go b/api/server/v1/httperror.pb.go index 8778ad26272..a71c3b4f133 100644 --- a/api/server/v1/httperror.pb.go +++ b/api/server/v1/httperror.pb.go @@ -7,13 +7,12 @@ package serverv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -120,14 +119,11 @@ func file_server_v1_httperror_proto_rawDescGZIP() []byte { return file_server_v1_httperror_proto_rawDescData } -var ( - file_server_v1_httperror_proto_msgTypes = make([]protoimpl.MessageInfo, 1) - file_server_v1_httperror_proto_goTypes = []any{ - (*HttpError)(nil), // 0: server.v1.HttpError - (*anypb.Any)(nil), // 1: google.protobuf.Any - } -) - +var file_server_v1_httperror_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_server_v1_httperror_proto_goTypes = []any{ + (*HttpError)(nil), // 0: server.v1.HttpError + (*anypb.Any)(nil), // 1: google.protobuf.Any +} var file_server_v1_httperror_proto_depIdxs = []int32{ 1, // 0: server.v1.HttpError.details:type_name -> google.protobuf.Any 1, // [1:1] is the sub-list for method output_type diff --git a/api/server/v1/httperror.swagger.json b/api/server/v1/httperror.swagger.json new file mode 100644 index 00000000000..7462173f0ff --- /dev/null +++ b/api/server/v1/httperror.swagger.json @@ -0,0 +1,46 @@ +{ + "swagger": "2.0", + "info": { + "title": "server/v1/httperror.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + } + }, + "additionalProperties": {}, + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/api/server/v1/server.pb.go b/api/server/v1/server.pb.go index 07eca02946e..0012d4e039d 100644 --- a/api/server/v1/server.pb.go +++ b/api/server/v1/server.pb.go @@ -7,18 +7,16 @@ package serverv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + common "github.com/percona/pmm/api/common" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - common "github.com/percona/pmm/api/common" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -1915,43 +1913,40 @@ func file_server_v1_server_proto_rawDescGZIP() []byte { return file_server_v1_server_proto_rawDescData } -var ( - file_server_v1_server_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_server_v1_server_proto_msgTypes = make([]protoimpl.MessageInfo, 26) - file_server_v1_server_proto_goTypes = []any{ - (DistributionMethod)(0), // 0: server.v1.DistributionMethod - (*VersionInfo)(nil), // 1: server.v1.VersionInfo - (*VersionRequest)(nil), // 2: server.v1.VersionRequest - (*VersionResponse)(nil), // 3: server.v1.VersionResponse - (*ReadinessRequest)(nil), // 4: server.v1.ReadinessRequest - (*ReadinessResponse)(nil), // 5: server.v1.ReadinessResponse - (*LeaderHealthCheckRequest)(nil), // 6: server.v1.LeaderHealthCheckRequest - (*LeaderHealthCheckResponse)(nil), // 7: server.v1.LeaderHealthCheckResponse - (*CheckUpdatesRequest)(nil), // 8: server.v1.CheckUpdatesRequest - (*DockerVersionInfo)(nil), // 9: server.v1.DockerVersionInfo - (*CheckUpdatesResponse)(nil), // 10: server.v1.CheckUpdatesResponse - (*ListChangeLogsRequest)(nil), // 11: server.v1.ListChangeLogsRequest - (*ListChangeLogsResponse)(nil), // 12: server.v1.ListChangeLogsResponse - (*StartUpdateRequest)(nil), // 13: server.v1.StartUpdateRequest - (*StartUpdateResponse)(nil), // 14: server.v1.StartUpdateResponse - (*UpdateStatusRequest)(nil), // 15: server.v1.UpdateStatusRequest - (*UpdateStatusResponse)(nil), // 16: server.v1.UpdateStatusResponse - (*MetricsResolutions)(nil), // 17: server.v1.MetricsResolutions - (*AdvisorRunIntervals)(nil), // 18: server.v1.AdvisorRunIntervals - (*Settings)(nil), // 19: server.v1.Settings - (*ReadOnlySettings)(nil), // 20: server.v1.ReadOnlySettings - (*GetSettingsRequest)(nil), // 21: server.v1.GetSettingsRequest - (*GetReadOnlySettingsRequest)(nil), // 22: server.v1.GetReadOnlySettingsRequest - (*GetSettingsResponse)(nil), // 23: server.v1.GetSettingsResponse - (*GetReadOnlySettingsResponse)(nil), // 24: server.v1.GetReadOnlySettingsResponse - (*ChangeSettingsRequest)(nil), // 25: server.v1.ChangeSettingsRequest - (*ChangeSettingsResponse)(nil), // 26: server.v1.ChangeSettingsResponse - (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 28: google.protobuf.Duration - (*common.StringArray)(nil), // 29: common.StringArray - } -) - +var file_server_v1_server_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_server_v1_server_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_server_v1_server_proto_goTypes = []any{ + (DistributionMethod)(0), // 0: server.v1.DistributionMethod + (*VersionInfo)(nil), // 1: server.v1.VersionInfo + (*VersionRequest)(nil), // 2: server.v1.VersionRequest + (*VersionResponse)(nil), // 3: server.v1.VersionResponse + (*ReadinessRequest)(nil), // 4: server.v1.ReadinessRequest + (*ReadinessResponse)(nil), // 5: server.v1.ReadinessResponse + (*LeaderHealthCheckRequest)(nil), // 6: server.v1.LeaderHealthCheckRequest + (*LeaderHealthCheckResponse)(nil), // 7: server.v1.LeaderHealthCheckResponse + (*CheckUpdatesRequest)(nil), // 8: server.v1.CheckUpdatesRequest + (*DockerVersionInfo)(nil), // 9: server.v1.DockerVersionInfo + (*CheckUpdatesResponse)(nil), // 10: server.v1.CheckUpdatesResponse + (*ListChangeLogsRequest)(nil), // 11: server.v1.ListChangeLogsRequest + (*ListChangeLogsResponse)(nil), // 12: server.v1.ListChangeLogsResponse + (*StartUpdateRequest)(nil), // 13: server.v1.StartUpdateRequest + (*StartUpdateResponse)(nil), // 14: server.v1.StartUpdateResponse + (*UpdateStatusRequest)(nil), // 15: server.v1.UpdateStatusRequest + (*UpdateStatusResponse)(nil), // 16: server.v1.UpdateStatusResponse + (*MetricsResolutions)(nil), // 17: server.v1.MetricsResolutions + (*AdvisorRunIntervals)(nil), // 18: server.v1.AdvisorRunIntervals + (*Settings)(nil), // 19: server.v1.Settings + (*ReadOnlySettings)(nil), // 20: server.v1.ReadOnlySettings + (*GetSettingsRequest)(nil), // 21: server.v1.GetSettingsRequest + (*GetReadOnlySettingsRequest)(nil), // 22: server.v1.GetReadOnlySettingsRequest + (*GetSettingsResponse)(nil), // 23: server.v1.GetSettingsResponse + (*GetReadOnlySettingsResponse)(nil), // 24: server.v1.GetReadOnlySettingsResponse + (*ChangeSettingsRequest)(nil), // 25: server.v1.ChangeSettingsRequest + (*ChangeSettingsResponse)(nil), // 26: server.v1.ChangeSettingsResponse + (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 28: google.protobuf.Duration + (*common.StringArray)(nil), // 29: common.StringArray +} var file_server_v1_server_proto_depIdxs = []int32{ 27, // 0: server.v1.VersionInfo.timestamp:type_name -> google.protobuf.Timestamp 1, // 1: server.v1.VersionResponse.server:type_name -> server.v1.VersionInfo diff --git a/api/server/v1/server.pb.validate.go b/api/server/v1/server.pb.validate.go index f684fea246b..dd94f1823e5 100644 --- a/api/server/v1/server.pb.validate.go +++ b/api/server/v1/server.pb.validate.go @@ -3317,6 +3317,7 @@ func (m *ChangeSettingsRequest) validate(all bool) error { } if m.AwsPartitions != nil { + if all { switch v := interface{}(m.GetAwsPartitions()).(type) { case interface{ ValidateAll() error }: @@ -3345,6 +3346,7 @@ func (m *ChangeSettingsRequest) validate(all bool) error { } } } + } if m.EnableAdvisor != nil { diff --git a/api/server/v1/server.swagger.json b/api/server/v1/server.swagger.json new file mode 100644 index 00000000000..d8ea983f495 --- /dev/null +++ b/api/server/v1/server.swagger.json @@ -0,0 +1,798 @@ +{ + "swagger": "2.0", + "info": { + "title": "server/v1/server.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "ServerService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/server/leaderHealthCheck": { + "get": { + "summary": "Check Leadership", + "description": "Checks if the instance is the leader in a cluster. Returns an error if the instance isn't the leader.", + "operationId": "LeaderHealthCheck", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1LeaderHealthCheckResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "ServerService" + ] + } + }, + "/v1/server/readyz": { + "get": { + "summary": "Check server readiness", + "description": "Returns an error when Server components being restarted are not ready yet. Use this API for checking the health of Docker containers and for probing Kubernetes readiness.", + "operationId": "Readiness", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ReadinessResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "ServerService" + ] + } + }, + "/v1/server/settings": { + "get": { + "summary": "Get settings", + "description": "Returns current PMM Server settings.", + "operationId": "GetSettings", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetSettingsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "ServerService" + ] + }, + "put": { + "summary": "Change settings", + "description": "Changes PMM Server settings.", + "operationId": "ChangeSettings", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ChangeSettingsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ChangeSettingsRequest" + } + } + ], + "tags": [ + "ServerService" + ] + } + }, + "/v1/server/settings/readonly": { + "get": { + "summary": "Get read-only settings", + "description": "Returns a stripped version of PMM Server settings.", + "operationId": "GetReadOnlySettings", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetReadOnlySettingsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "ServerService" + ] + } + }, + "/v1/server/updates": { + "get": { + "summary": "Check updates", + "description": "Checks for available PMM Server updates.", + "operationId": "CheckUpdates", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CheckUpdatesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "force", + "description": "If false, cached information may be returned.", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "only_installed_version", + "description": "If true, only installed version will be in response.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "ServerService" + ] + } + }, + "/v1/server/updates/changelogs": { + "get": { + "summary": "Get the changelog", + "description": "Display a changelog comparing the installed version to the latest available version.", + "operationId": "ListChangeLogs", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListChangeLogsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "ServerService" + ] + } + }, + "/v1/server/updates:getStatus": { + "post": { + "summary": "Update status", + "description": "Returns PMM Server update status.", + "operationId": "UpdateStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateStatusRequest" + } + } + ], + "tags": [ + "ServerService" + ] + } + }, + "/v1/server/updates:start": { + "post": { + "summary": "Start update", + "description": "Starts PMM Server update.", + "operationId": "StartUpdate", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StartUpdateResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1StartUpdateRequest" + } + } + ], + "tags": [ + "ServerService" + ] + } + }, + "/v1/server/version": { + "get": { + "summary": "Version", + "description": "Returns PMM Server versions.", + "operationId": "Version", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1VersionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "dummy", + "description": "Dummy parameter for internal testing. Do not use.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "ServerService" + ] + } + } + }, + "definitions": { + "commonStringArray": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "A wrapper for a string array. This type allows to distinguish between an empty array and a null value." + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + } + }, + "additionalProperties": {}, + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1AdvisorRunIntervals": { + "type": "object", + "properties": { + "standard_interval": { + "type": "string", + "description": "Standard check interval." + }, + "rare_interval": { + "type": "string", + "description": "Interval for rare check runs." + }, + "frequent_interval": { + "type": "string", + "description": "Interval for frequent check runs." + } + }, + "description": "AdvisorRunIntervals represents intervals between each run of Advisor checks." + }, + "v1ChangeSettingsRequest": { + "type": "object", + "properties": { + "enable_updates": { + "type": "boolean", + "x-nullable": true + }, + "enable_telemetry": { + "type": "boolean", + "x-nullable": true + }, + "metrics_resolutions": { + "$ref": "#/definitions/v1MetricsResolutions" + }, + "data_retention": { + "type": "string", + "description": "A number of full days for Prometheus and QAN data retention. Should have a suffix in JSON: 2592000s, 43200m, 720h." + }, + "ssh_key": { + "type": "string", + "x-nullable": true + }, + "aws_partitions": { + "$ref": "#/definitions/commonStringArray", + "x-nullable": true + }, + "enable_advisor": { + "type": "boolean", + "x-nullable": true, + "description": "Enable Advisor." + }, + "enable_alerting": { + "type": "boolean", + "x-nullable": true, + "description": "Enable Alerting." + }, + "pmm_public_address": { + "type": "string", + "x-nullable": true, + "description": "PMM Server public address." + }, + "advisor_run_intervals": { + "$ref": "#/definitions/v1AdvisorRunIntervals", + "description": "Intervals between Advisor runs." + }, + "enable_azurediscover": { + "type": "boolean", + "x-nullable": true, + "description": "Enable Azure Discover." + }, + "enable_backup_management": { + "type": "boolean", + "x-nullable": true, + "description": "Enable Backup Management." + }, + "enable_access_control": { + "type": "boolean", + "x-nullable": true, + "title": "Enable Access Control" + }, + "enable_internal_pg_qan": { + "type": "boolean", + "x-nullable": true, + "description": "Enable Query Analytics for PMM's internal PG database." + }, + "update_snooze_duration": { + "type": "string", + "description": "A number of full days for which an update is snoozed, i.e. a multiple of 24h: 2592000s, 43200m, 720h." + } + } + }, + "v1ChangeSettingsResponse": { + "type": "object", + "properties": { + "settings": { + "$ref": "#/definitions/v1Settings" + } + } + }, + "v1CheckUpdatesResponse": { + "type": "object", + "properties": { + "installed": { + "$ref": "#/definitions/v1VersionInfo", + "description": "Currently installed PMM Server version." + }, + "latest": { + "$ref": "#/definitions/v1DockerVersionInfo", + "description": "Latest available PMM Server version." + }, + "update_available": { + "type": "boolean", + "description": "True if there is a PMM Server update available." + }, + "latest_news_url": { + "type": "string", + "description": "Latest available PMM Server release announcement URL." + }, + "last_check": { + "type": "string", + "format": "date-time", + "description": "Last check time." + } + } + }, + "v1DistributionMethod": { + "type": "string", + "enum": [ + "DISTRIBUTION_METHOD_UNSPECIFIED", + "DISTRIBUTION_METHOD_DOCKER", + "DISTRIBUTION_METHOD_OVF", + "DISTRIBUTION_METHOD_AMI", + "DISTRIBUTION_METHOD_AZURE", + "DISTRIBUTION_METHOD_DO" + ], + "default": "DISTRIBUTION_METHOD_UNSPECIFIED", + "description": "DistributionMethod defines PMM Server distribution method: Docker image, OVF/OVA, or AMI." + }, + "v1DockerVersionInfo": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "PMM Version." + }, + "tag": { + "type": "string", + "description": "Docker image tag." + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "Release date." + }, + "release_notes_url": { + "type": "string", + "description": "Release notes URL for the version (if available)." + }, + "release_notes_text": { + "type": "string", + "description": "Release notes text for the version (if available)." + } + } + }, + "v1GetReadOnlySettingsResponse": { + "type": "object", + "properties": { + "settings": { + "$ref": "#/definitions/v1ReadOnlySettings" + } + } + }, + "v1GetSettingsResponse": { + "type": "object", + "properties": { + "settings": { + "$ref": "#/definitions/v1Settings" + } + } + }, + "v1LeaderHealthCheckResponse": { + "type": "object", + "description": "This probe is available without authentication, so it should not contain any data." + }, + "v1ListChangeLogsResponse": { + "type": "object", + "properties": { + "updates": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1DockerVersionInfo" + }, + "description": "List of available updates." + }, + "last_check": { + "type": "string", + "format": "date-time", + "description": "Last check time." + } + } + }, + "v1MetricsResolutions": { + "type": "object", + "properties": { + "hr": { + "type": "string", + "description": "High resolution. Should have a suffix in JSON: 1s, 1m, 1h." + }, + "mr": { + "type": "string", + "description": "Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h." + }, + "lr": { + "type": "string", + "description": "Low resolution. Should have a suffix in JSON: 1s, 1m, 1h." + } + }, + "description": "MetricsResolutions represents Prometheus exporters metrics resolutions." + }, + "v1ReadOnlySettings": { + "type": "object", + "properties": { + "updates_enabled": { + "type": "boolean", + "description": "True if updates are enabled." + }, + "telemetry_enabled": { + "type": "boolean", + "description": "True if telemetry is enabled." + }, + "advisor_enabled": { + "type": "boolean", + "description": "True if Advisor is enabled." + }, + "alerting_enabled": { + "type": "boolean", + "description": "True if Alerting is enabled." + }, + "pmm_public_address": { + "type": "string", + "description": "PMM Server public address." + }, + "backup_management_enabled": { + "type": "boolean", + "description": "True if Backup Management is enabled." + }, + "azurediscover_enabled": { + "type": "boolean", + "description": "True if Azure Discover is enabled." + }, + "enable_access_control": { + "type": "boolean", + "description": "True if Access Control is enabled." + } + }, + "description": "ReadOnlySettings represents a stripped-down version of PMM Server settings that can be accessed by users of all roles." + }, + "v1ReadinessResponse": { + "type": "object", + "description": "This probe is available without authentication, so it should not contain any data." + }, + "v1Settings": { + "type": "object", + "properties": { + "updates_enabled": { + "type": "boolean", + "description": "True if updates are enabled." + }, + "telemetry_enabled": { + "type": "boolean", + "description": "True if telemetry is enabled." + }, + "metrics_resolutions": { + "$ref": "#/definitions/v1MetricsResolutions" + }, + "data_retention": { + "type": "string" + }, + "ssh_key": { + "type": "string" + }, + "aws_partitions": { + "type": "array", + "items": { + "type": "string" + } + }, + "advisor_enabled": { + "type": "boolean", + "description": "True if Advisor is enabled." + }, + "platform_email": { + "type": "string" + }, + "alerting_enabled": { + "type": "boolean", + "description": "True if Alerting is enabled." + }, + "pmm_public_address": { + "type": "string", + "description": "PMM Server public address." + }, + "advisor_run_intervals": { + "$ref": "#/definitions/v1AdvisorRunIntervals", + "description": "Intervals between Advisor runs." + }, + "backup_management_enabled": { + "type": "boolean", + "description": "True if Backup Management is enabled." + }, + "azurediscover_enabled": { + "type": "boolean", + "description": "True if Azure Discover is enabled." + }, + "connected_to_platform": { + "type": "boolean", + "title": "True if the PMM instance is connected to Platform" + }, + "telemetry_summaries": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Includes list of collected telemetry" + }, + "enable_access_control": { + "type": "boolean", + "description": "True if Access Control is enabled." + }, + "default_role_id": { + "type": "integer", + "format": "int64", + "description": "Default Access Control role ID for new users." + }, + "enable_internal_pg_qan": { + "type": "boolean", + "description": "True if Query Analytics for PMM's internal PG database is enabled." + }, + "update_snooze_duration": { + "type": "string", + "title": "Duration for which an update is snoozed" + } + }, + "description": "Settings represents PMM Server settings." + }, + "v1StartUpdateRequest": { + "type": "object", + "properties": { + "new_image": { + "type": "string" + } + } + }, + "v1StartUpdateResponse": { + "type": "object", + "properties": { + "auth_token": { + "type": "string", + "description": "Authentication token for getting update statuses." + }, + "log_offset": { + "type": "integer", + "format": "int64", + "description": "Progress log offset." + } + } + }, + "v1UpdateStatusRequest": { + "type": "object", + "properties": { + "auth_token": { + "type": "string", + "description": "Authentication token." + }, + "log_offset": { + "type": "integer", + "format": "int64", + "description": "Progress log offset." + } + } + }, + "v1UpdateStatusResponse": { + "type": "object", + "properties": { + "log_lines": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Progress log lines." + }, + "log_offset": { + "type": "integer", + "format": "int64", + "description": "Progress log offset for the next request." + }, + "done": { + "type": "boolean", + "description": "True when update is done." + } + } + }, + "v1VersionInfo": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "User-visible version." + }, + "full_version": { + "type": "string", + "description": "Full version for debugging." + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "Build or release date." + } + }, + "description": "VersionInfo describes component version, or PMM Server as a whole." + }, + "v1VersionResponse": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "PMM Server version." + }, + "server": { + "$ref": "#/definitions/v1VersionInfo", + "description": "Detailed PMM Server version information." + }, + "managed": { + "$ref": "#/definitions/v1VersionInfo", + "description": "pmm-managed version information for debugging." + }, + "distribution_method": { + "$ref": "#/definitions/v1DistributionMethod", + "description": "PMM Server distribution method.\n\nTODO Versions and statuses of Grafana, Prometheus, PostgreSQL, qan-api2, ClickHouse, pmm-agent, etc." + } + } + } + } +} diff --git a/api/server/v1/server_grpc.pb.go b/api/server/v1/server_grpc.pb.go index 29719f730c8..145fe2a7a18 100644 --- a/api/server/v1/server_grpc.pb.go +++ b/api/server/v1/server_grpc.pb.go @@ -8,7 +8,6 @@ package serverv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -209,39 +208,30 @@ type UnimplementedServerServiceServer struct{} func (UnimplementedServerServiceServer) Version(context.Context, *VersionRequest) (*VersionResponse, error) { return nil, status.Error(codes.Unimplemented, "method Version not implemented") } - func (UnimplementedServerServiceServer) Readiness(context.Context, *ReadinessRequest) (*ReadinessResponse, error) { return nil, status.Error(codes.Unimplemented, "method Readiness not implemented") } - func (UnimplementedServerServiceServer) LeaderHealthCheck(context.Context, *LeaderHealthCheckRequest) (*LeaderHealthCheckResponse, error) { return nil, status.Error(codes.Unimplemented, "method LeaderHealthCheck not implemented") } - func (UnimplementedServerServiceServer) CheckUpdates(context.Context, *CheckUpdatesRequest) (*CheckUpdatesResponse, error) { return nil, status.Error(codes.Unimplemented, "method CheckUpdates not implemented") } - func (UnimplementedServerServiceServer) ListChangeLogs(context.Context, *ListChangeLogsRequest) (*ListChangeLogsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListChangeLogs not implemented") } - func (UnimplementedServerServiceServer) StartUpdate(context.Context, *StartUpdateRequest) (*StartUpdateResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartUpdate not implemented") } - func (UnimplementedServerServiceServer) UpdateStatus(context.Context, *UpdateStatusRequest) (*UpdateStatusResponse, error) { return nil, status.Error(codes.Unimplemented, "method UpdateStatus not implemented") } - func (UnimplementedServerServiceServer) GetSettings(context.Context, *GetSettingsRequest) (*GetSettingsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetSettings not implemented") } - func (UnimplementedServerServiceServer) GetReadOnlySettings(context.Context, *GetReadOnlySettingsRequest) (*GetReadOnlySettingsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetReadOnlySettings not implemented") } - func (UnimplementedServerServiceServer) ChangeSettings(context.Context, *ChangeSettingsRequest) (*ChangeSettingsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ChangeSettings not implemented") } diff --git a/api/uievents/v1/server.pb.go b/api/uievents/v1/server.pb.go index 41d144b9c29..6f3472d1deb 100644 --- a/api/uievents/v1/server.pb.go +++ b/api/uievents/v1/server.pb.go @@ -7,14 +7,13 @@ package uieventsv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -468,19 +467,16 @@ func file_uievents_v1_server_proto_rawDescGZIP() []byte { return file_uievents_v1_server_proto_rawDescData } -var ( - file_uievents_v1_server_proto_msgTypes = make([]protoimpl.MessageInfo, 7) - file_uievents_v1_server_proto_goTypes = []any{ - (*NotificationEvent)(nil), // 0: uievents.v1.NotificationEvent - (*FetchingEvent)(nil), // 1: uievents.v1.FetchingEvent - (*DashboardUsageEvent)(nil), // 2: uievents.v1.DashboardUsageEvent - (*UserFlowEvent)(nil), // 3: uievents.v1.UserFlowEvent - (*StoreRequest)(nil), // 4: uievents.v1.StoreRequest - (*StoreResponse)(nil), // 5: uievents.v1.StoreResponse - nil, // 6: uievents.v1.UserFlowEvent.ParamsEntry - } -) - +var file_uievents_v1_server_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_uievents_v1_server_proto_goTypes = []any{ + (*NotificationEvent)(nil), // 0: uievents.v1.NotificationEvent + (*FetchingEvent)(nil), // 1: uievents.v1.FetchingEvent + (*DashboardUsageEvent)(nil), // 2: uievents.v1.DashboardUsageEvent + (*UserFlowEvent)(nil), // 3: uievents.v1.UserFlowEvent + (*StoreRequest)(nil), // 4: uievents.v1.StoreRequest + (*StoreResponse)(nil), // 5: uievents.v1.StoreResponse + nil, // 6: uievents.v1.UserFlowEvent.ParamsEntry +} var file_uievents_v1_server_proto_depIdxs = []int32{ 6, // 0: uievents.v1.UserFlowEvent.params:type_name -> uievents.v1.UserFlowEvent.ParamsEntry 0, // 1: uievents.v1.StoreRequest.notifications:type_name -> uievents.v1.NotificationEvent diff --git a/api/uievents/v1/server.pb.gw.go b/api/uievents/v1/server.pb.gw.go index 7a044e6b3ba..e968c8546df 100644 --- a/api/uievents/v1/server.pb.gw.go +++ b/api/uievents/v1/server.pb.gw.go @@ -148,6 +148,10 @@ func RegisterUIEventsServiceHandlerClient(ctx context.Context, mux *runtime.Serv return nil } -var pattern_UIEventsService_Store_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ui-events", "Store"}, "")) +var ( + pattern_UIEventsService_Store_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ui-events", "Store"}, "")) +) -var forward_UIEventsService_Store_0 = runtime.ForwardResponseMessage +var ( + forward_UIEventsService_Store_0 = runtime.ForwardResponseMessage +) diff --git a/api/uievents/v1/server.swagger.json b/api/uievents/v1/server.swagger.json new file mode 100644 index 00000000000..b77aec150ac --- /dev/null +++ b/api/uievents/v1/server.swagger.json @@ -0,0 +1,202 @@ +{ + "swagger": "2.0", + "info": { + "title": "uievents/v1/server.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "UIEventsService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/ui-events/Store": { + "post": { + "summary": "Persist UI events", + "description": "Persists received UI events for further processing.", + "operationId": "Store", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StoreResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1StoreRequest" + } + } + ], + "tags": [ + "UIEventsService" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1DashboardUsageEvent": { + "type": "object", + "properties": { + "uid": { + "type": "string" + }, + "title": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "load_time": { + "type": "integer", + "format": "int32" + }, + "location": { + "type": "string" + }, + "location_params": { + "type": "string" + } + } + }, + "v1FetchingEvent": { + "type": "object", + "properties": { + "component": { + "type": "string" + }, + "load_time": { + "type": "integer", + "format": "int32" + }, + "location": { + "type": "string" + }, + "location_params": { + "type": "string" + } + } + }, + "v1NotificationEvent": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "text": { + "type": "string" + }, + "location": { + "type": "string" + }, + "location_params": { + "type": "string" + } + } + }, + "v1StoreRequest": { + "type": "object", + "properties": { + "notifications": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1NotificationEvent" + } + }, + "fetching": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1FetchingEvent" + } + }, + "dashboard_usage": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1DashboardUsageEvent" + } + }, + "user_flow_events": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1UserFlowEvent" + } + } + } + }, + "v1StoreResponse": { + "type": "object" + }, + "v1UserFlowEvent": { + "type": "object", + "properties": { + "flow_id": { + "type": "string" + }, + "story_id": { + "type": "string" + }, + "event": { + "type": "string" + }, + "params": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } +} diff --git a/api/uievents/v1/server_grpc.pb.go b/api/uievents/v1/server_grpc.pb.go index f4343f61ac3..3a3848baa05 100644 --- a/api/uievents/v1/server_grpc.pb.go +++ b/api/uievents/v1/server_grpc.pb.go @@ -8,7 +8,6 @@ package uieventsv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/user/v1/user.pb.go b/api/user/v1/user.pb.go index 12a954ca3f4..ea4c06a469e 100644 --- a/api/user/v1/user.pb.go +++ b/api/user/v1/user.pb.go @@ -7,15 +7,14 @@ package userv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -494,20 +493,17 @@ func file_user_v1_user_proto_rawDescGZIP() []byte { return file_user_v1_user_proto_rawDescData } -var ( - file_user_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 7) - file_user_v1_user_proto_goTypes = []any{ - (*GetUserRequest)(nil), // 0: user.v1.GetUserRequest - (*GetUserResponse)(nil), // 1: user.v1.GetUserResponse - (*UpdateUserRequest)(nil), // 2: user.v1.UpdateUserRequest - (*UpdateUserResponse)(nil), // 3: user.v1.UpdateUserResponse - (*ListUsersRequest)(nil), // 4: user.v1.ListUsersRequest - (*ListUsersResponse)(nil), // 5: user.v1.ListUsersResponse - (*ListUsersResponse_UserDetail)(nil), // 6: user.v1.ListUsersResponse.UserDetail - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp - } -) - +var file_user_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_user_v1_user_proto_goTypes = []any{ + (*GetUserRequest)(nil), // 0: user.v1.GetUserRequest + (*GetUserResponse)(nil), // 1: user.v1.GetUserResponse + (*UpdateUserRequest)(nil), // 2: user.v1.UpdateUserRequest + (*UpdateUserResponse)(nil), // 3: user.v1.UpdateUserResponse + (*ListUsersRequest)(nil), // 4: user.v1.ListUsersRequest + (*ListUsersResponse)(nil), // 5: user.v1.ListUsersResponse + (*ListUsersResponse_UserDetail)(nil), // 6: user.v1.ListUsersResponse.UserDetail + (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp +} var file_user_v1_user_proto_depIdxs = []int32{ 7, // 0: user.v1.GetUserResponse.snoozed_at:type_name -> google.protobuf.Timestamp 7, // 1: user.v1.UpdateUserResponse.snoozed_at:type_name -> google.protobuf.Timestamp diff --git a/api/user/v1/user.swagger.json b/api/user/v1/user.swagger.json new file mode 100644 index 00000000000..736cc43bfc0 --- /dev/null +++ b/api/user/v1/user.swagger.json @@ -0,0 +1,243 @@ +{ + "swagger": "2.0", + "info": { + "title": "User API", + "version": "version not set" + }, + "tags": [ + { + "name": "UserService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/users": { + "get": { + "summary": "List all users", + "description": "Retrieve user details for all users from PMM server", + "operationId": "ListUsers", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListUsersResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "UserService" + ] + } + }, + "/v1/users/me": { + "get": { + "summary": "Get user details", + "description": "Retrieve user details from PMM server", + "operationId": "GetUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetUserResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "UserService" + ] + }, + "put": { + "summary": "Update a user", + "description": "Update user details in PMM server", + "operationId": "UpdateUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateUserResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateUserRequest" + } + } + ], + "tags": [ + "UserService" + ] + } + } + }, + "definitions": { + "ListUsersResponseUserDetail": { + "type": "object", + "properties": { + "user_id": { + "type": "integer", + "format": "int64" + }, + "role_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "List of role IDs assigned to the user." + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1GetUserResponse": { + "type": "object", + "properties": { + "user_id": { + "type": "integer", + "format": "int64", + "title": "User ID" + }, + "product_tour_completed": { + "type": "boolean", + "title": "Product Tour" + }, + "alerting_tour_completed": { + "type": "boolean", + "title": "Alerting Tour" + }, + "snoozed_pmm_version": { + "type": "string", + "title": "Snoozed PMM version update" + }, + "snoozed_at": { + "type": "string", + "format": "date-time", + "title": "Timestamp of last snooze" + }, + "snooze_count": { + "type": "integer", + "format": "int64", + "title": "Number of times the update was snoozed" + } + } + }, + "v1ListUsersResponse": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/ListUsersResponseUserDetail" + } + } + } + }, + "v1UpdateUserRequest": { + "type": "object", + "properties": { + "product_tour_completed": { + "type": "boolean", + "x-nullable": true, + "title": "Product Tour" + }, + "alerting_tour_completed": { + "type": "boolean", + "x-nullable": true, + "title": "Alerting Tour" + }, + "snoozed_pmm_version": { + "type": "string", + "x-nullable": true, + "title": "Snooze update alert for a PMM version" + } + } + }, + "v1UpdateUserResponse": { + "type": "object", + "properties": { + "user_id": { + "type": "integer", + "format": "int64", + "title": "User ID" + }, + "product_tour_completed": { + "type": "boolean", + "title": "Product Tour" + }, + "alerting_tour_completed": { + "type": "boolean", + "title": "Alerting Tour" + }, + "snoozed_pmm_version": { + "type": "string", + "title": "Snooze update alert for a PMM version" + }, + "snoozed_at": { + "type": "string", + "format": "date-time", + "title": "Timestamp of last snooze" + }, + "snooze_count": { + "type": "integer", + "format": "int64", + "title": "Number of times the update was snoozed" + } + } + } + } +} diff --git a/api/user/v1/user_grpc.pb.go b/api/user/v1/user_grpc.pb.go index 4201de2b381..5166f03fc21 100644 --- a/api/user/v1/user_grpc.pb.go +++ b/api/user/v1/user_grpc.pb.go @@ -8,7 +8,6 @@ package userv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -96,11 +95,9 @@ type UnimplementedUserServiceServer struct{} func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetUser not implemented") } - func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) { return nil, status.Error(codes.Unimplemented, "method UpdateUser not implemented") } - func (UnimplementedUserServiceServer) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListUsers not implemented") } diff --git a/build/ansible/pmm-docker/post-build.yml b/build/ansible/pmm-docker/post-build.yml index 483e3f7bcea..0712573ac2b 100644 --- a/build/ansible/pmm-docker/post-build.yml +++ b/build/ansible/pmm-docker/post-build.yml @@ -83,6 +83,28 @@ - name: Clean pmm-server dir shell: find /usr/share/pmm-server -mindepth 1 -maxdepth 1 -print0 | xargs -0 rm -rf -- + # The cleanup above removes nginx static assets (e.g. local-rss.xml, install-pmm-client.sh) + # that were copied earlier by roles/nginx. Restore them from the ansible tree still present + # in the image at /opt/ansible (see build/docker/server/Dockerfile.el9). + - name: Recreate pmm-static directory for nginx + file: + path: /usr/share/pmm-server/static + state: directory + owner: pmm + group: root + mode: "0775" + + - name: Restore nginx /pmm-static files after pmm-server cleanup + copy: + src: "/opt/ansible/roles/nginx/files/{{ item.name }}" + dest: "/usr/share/pmm-server/static/{{ item.name }}" + owner: pmm + group: root + mode: "{{ item.mode }}" + loop: + - { name: local-rss.xml, mode: "0644" } + - { name: install-pmm-client.sh, mode: "0755" } + # This step is required because of a change between VictoriaMetrics 1.77.1 and 1.82.1. # VictoriaMetrics tries to atomically rename directories in this folder on startup. # With RedHat-based docker images the rename fails with an error "Invalid cross-device link". diff --git a/managed/services/grafana/auth_server_test.go b/managed/services/grafana/auth_server_test.go index bf2d411b87f..eb1e4b72910 100644 --- a/managed/services/grafana/auth_server_test.go +++ b/managed/services/grafana/auth_server_test.go @@ -107,6 +107,7 @@ func TestAuthServerAuthenticate(t *testing.T) { "/management.v1.ManagementService/RemoveService": admin, "/management.v1.ManagementService/ListServices": admin, "/management.v1.ManagementService/AddAnnotation": admin, + "/management.v1.ManagementService/CreateNodeInstallToken": admin, "/server.v1.ServerService/CheckUpdates": viewer, "/server.v1.ServerService/StartUpdate": admin, "/server.v1.ServerService/UpdateStatus": none, diff --git a/managed/services/grafana/client.go b/managed/services/grafana/client.go index d0c50504aa8..63ae3d58ebd 100644 --- a/managed/services/grafana/client.go +++ b/managed/services/grafana/client.go @@ -48,6 +48,8 @@ var ErrFailedToGetToken = errors.New("failed to get the user token") const ( pmmServiceTokenName = "pmm-agent-st" //nolint:gosec pmmServiceAccountName = "pmm-agent-sa" //nolint:gosec + pmmInstallServiceTokenPrefix = "pmm-install-st" //nolint:gosec + pmmInstallServiceAccountName = "pmm-install-sa" //nolint:gosec defaultDialTimeout = 3 * time.Second defaultKeepAliveTimeout = 30 * time.Second defaultIdleConnTimeout = 90 * time.Second @@ -427,6 +429,67 @@ func (c *Client) CreateServiceAccount(ctx context.Context, nodeName string, rere return serviceAccountID, serviceToken, nil } +// CreateNodeInstallToken creates a Grafana service account and a short-lived token (secondsToLive) for PMM Client install scripts. +func (c *Client) CreateNodeInstallToken(ctx context.Context, uniqueSuffix string, ttlSeconds int64) (int64, string, time.Time, error) { + authHeaders, err := auth.GetHeadersFromContext(ctx) + if err != nil { + return 0, "", time.Time{}, err + } + if ttlSeconds <= 0 { + return 0, "", time.Time{}, errors.New("ttlSeconds must be positive") + } + + saID, err := c.createInstallServiceAccount(ctx, uniqueSuffix, authHeaders) + if err != nil { + return 0, "", time.Time{}, err + } + + _, tok, err := c.createInstallServiceToken(ctx, saID, uniqueSuffix, ttlSeconds, authHeaders) + if err != nil { + return 0, "", time.Time{}, err + } + + return int64(saID), tok, time.Now().Add(time.Duration(ttlSeconds) * time.Second), nil +} + +func (c *Client) createInstallServiceAccount(ctx context.Context, uniqueSuffix string, authHeaders http.Header) (int, error) { + serviceAccountName := fmt.Sprintf("%s-%s", pmmInstallServiceAccountName, uniqueSuffix) + return c.createServiceAccountNamed(ctx, serviceAccountName, admin, false, authHeaders) +} + +func (c *Client) createInstallServiceToken( + ctx context.Context, + serviceAccountID int, + uniqueSuffix string, + ttlSeconds int64, + authHeaders http.Header, +) (int, string, error) { + tokenName := fmt.Sprintf("%s-%s", pmmInstallServiceTokenPrefix, uniqueSuffix) + b, err := json.Marshal(struct { + Name string `json:"name"` + Role string `json:"role"` + SecondsToLive int64 `json:"secondsToLive"` + }{ + Name: tokenName, + Role: admin.String(), + SecondsToLive: ttlSeconds, + }) + if err != nil { + return 0, "", errors.WithStack(err) + } + + var m map[string]interface{} + if err = c.do(ctx, "POST", fmt.Sprintf("/api/serviceaccounts/%d/tokens", serviceAccountID), "", authHeaders, b, &m); err != nil { + return 0, "", err + } + serviceTokenKey, ok := m["key"].(string) + if !ok { + return 0, "", errors.Errorf("grafana token response missing key: %#v", m) + } + + return 0, serviceTokenKey, nil +} + // DeleteServiceAccount deletes service account by current service token. func (c *Client) DeleteServiceAccount(ctx context.Context, nodeName string, force bool) (string, error) { authHeaders, err := auth.GetHeadersFromContext(ctx) @@ -633,7 +696,12 @@ func (c *Client) createServiceAccount(ctx context.Context, role role, nodeName s } serviceAccountName := fmt.Sprintf("%s-%s", pmmServiceAccountName, nodeName) - b, err := json.Marshal(serviceAccount{Name: serviceAccountName, Role: role.String(), Force: reregister}) + return c.createServiceAccountNamed(ctx, serviceAccountName, role, reregister, authHeaders) +} + +// createServiceAccountNamed POSTs a service account and PATCHes orgId to 1. +func (c *Client) createServiceAccountNamed(ctx context.Context, serviceAccountName string, role role, force bool, authHeaders http.Header) (int, error) { + b, err := json.Marshal(serviceAccount{Name: serviceAccountName, Role: role.String(), Force: force}) if err != nil { return 0, errors.WithStack(err) } diff --git a/managed/services/management/deps.go b/managed/services/management/deps.go index aa94b71a44a..c5bc678bdda 100644 --- a/managed/services/management/deps.go +++ b/managed/services/management/deps.go @@ -70,6 +70,7 @@ type checksService interface { type grafanaClient interface { CreateAnnotation(ctx context.Context, tags []string, time time.Time, text string, user string) (string, error) CreateServiceAccount(ctx context.Context, noneName string, reregister bool) (int, string, error) + CreateNodeInstallToken(ctx context.Context, uniqueSuffix string, ttlSeconds int64) (int64, string, time.Time, error) DeleteServiceAccount(ctx context.Context, noneName string, force bool) (string, error) } diff --git a/managed/services/management/install_token.go b/managed/services/management/install_token.go new file mode 100644 index 00000000000..add90c9338f --- /dev/null +++ b/managed/services/management/install_token.go @@ -0,0 +1,76 @@ +// Copyright (C) 2023 Percona LLC +// +// This program 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 management + +import ( + "context" + "fmt" + "strings" + "time" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" + + managementv1 "github.com/percona/pmm/api/management/v1" +) + +const ( + defaultInstallTokenTTLSeconds = int64(86400) + maxInstallTokenTTLSeconds = int64(86400) + minInstallTokenTTLSeconds = int64(60) +) + +var installTokenTechnologies = map[string]struct{}{ + "mysql": {}, + "postgresql": {}, + "mongodb": {}, + "valkey": {}, +} + +// CreateNodeInstallToken mints a short-lived Grafana token for PMM Client install; it does not create inventory rows. +func (s *ManagementService) CreateNodeInstallToken( + ctx context.Context, + req *managementv1.CreateNodeInstallTokenRequest, +) (*managementv1.CreateNodeInstallTokenResponse, error) { + tech := strings.ToLower(strings.TrimSpace(req.GetTechnology())) + if _, ok := installTokenTechnologies[tech]; !ok { + return nil, status.Errorf(codes.InvalidArgument, "unsupported technology %q (expected mysql, postgresql, mongodb, or valkey)", req.GetTechnology()) + } + + ttl := int64(req.GetTtlSeconds()) + if ttl == 0 { + ttl = defaultInstallTokenTTLSeconds + } + if ttl < minInstallTokenTTLSeconds { + ttl = minInstallTokenTTLSeconds + } + if ttl > maxInstallTokenTTLSeconds { + ttl = maxInstallTokenTTLSeconds + } + + unique := fmt.Sprintf("%s-%d", tech, time.Now().UnixNano()) + saID, tok, exp, err := s.grafanaClient.CreateNodeInstallToken(ctx, unique, ttl) + if err != nil { + return nil, err + } + + return &managementv1.CreateNodeInstallTokenResponse{ + Token: tok, + ExpiresAt: timestamppb.New(exp), + ServiceAccountId: saID, + }, nil +} diff --git a/managed/services/management/install_token_test.go b/managed/services/management/install_token_test.go new file mode 100644 index 00000000000..11cc2a1e370 --- /dev/null +++ b/managed/services/management/install_token_test.go @@ -0,0 +1,88 @@ +// Copyright (C) 2023 Percona LLC +// +// This program 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 management + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + managementv1 "github.com/percona/pmm/api/management/v1" +) + +func TestManagementService_CreateNodeInstallToken(t *testing.T) { + t.Parallel() + + ctx := context.Background() + exp := time.Now().Add(24 * time.Hour) + + t.Run("ok", func(t *testing.T) { + t.Parallel() + gc := &mockGrafanaClient{} + gc.On("CreateNodeInstallToken", mock.Anything, mock.MatchedBy(func(s string) bool { return s != "" }), int64(86400)). + Return(int64(42), "tok", exp, nil).Once() + + s := &ManagementService{grafanaClient: gc} + res, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{ + TtlSeconds: 0, + Technology: "mysql", + }) + require.NoError(t, err) + require.Equal(t, "tok", res.Token) + require.Equal(t, int64(42), res.ServiceAccountId) + require.NotNil(t, res.ExpiresAt) + }) + + t.Run("invalid technology", func(t *testing.T) { + t.Parallel() + s := &ManagementService{grafanaClient: &mockGrafanaClient{}} + _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{Technology: "oracle"}) + require.Error(t, err) + assert.Equal(t, codes.InvalidArgument, status.Code(err)) + }) + + t.Run("ttl clamp max", func(t *testing.T) { + t.Parallel() + gc := &mockGrafanaClient{} + gc.On("CreateNodeInstallToken", mock.Anything, mock.Anything, int64(maxInstallTokenTTLSeconds)). + Return(int64(1), "t", exp, nil).Once() + s := &ManagementService{grafanaClient: gc} + _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{ + TtlSeconds: 999999999, + Technology: "postgresql", + }) + require.NoError(t, err) + }) + + t.Run("ttl clamp min", func(t *testing.T) { + t.Parallel() + gc := &mockGrafanaClient{} + gc.On("CreateNodeInstallToken", mock.Anything, mock.Anything, int64(minInstallTokenTTLSeconds)). + Return(int64(1), "t", exp, nil).Once() + s := &ManagementService{grafanaClient: gc} + _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{ + TtlSeconds: 30, + Technology: "mongodb", + }) + require.NoError(t, err) + }) +} diff --git a/managed/services/management/mock_grafana_client_test.go b/managed/services/management/mock_grafana_client_test.go index eeb8dc89818..feabcf744da 100644 --- a/managed/services/management/mock_grafana_client_test.go +++ b/managed/services/management/mock_grafana_client_test.go @@ -77,6 +77,31 @@ func (_m *mockGrafanaClient) CreateServiceAccount(ctx context.Context, noneName return r0, r1, r2 } +// CreateNodeInstallToken provides a mock function for install-token flow. +func (_m *mockGrafanaClient) CreateNodeInstallToken(ctx context.Context, uniqueSuffix string, ttlSeconds int64) (int64, string, time.Time, error) { + ret := _m.Called(ctx, uniqueSuffix, ttlSeconds) + + var r0 int64 + var r1 string + var r2 time.Time + var r3 error + if rf, ok := ret.Get(0).(func(context.Context, string, int64) (int64, string, time.Time, error)); ok { + return rf(ctx, uniqueSuffix, ttlSeconds) + } + if ret.Get(0) != nil { + r0 = ret.Get(0).(int64) + } + if ret.Get(1) != nil { + r1 = ret.Get(1).(string) + } + if ret.Get(2) != nil { + r2 = ret.Get(2).(time.Time) + } + r3 = ret.Error(3) + + return r0, r1, r2, r3 +} + // DeleteServiceAccount provides a mock function with given fields: ctx, noneName, force func (_m *mockGrafanaClient) DeleteServiceAccount(ctx context.Context, noneName string, force bool) (string, error) { ret := _m.Called(ctx, noneName, force) diff --git a/ui/apps/pmm/src/api/installToken.ts b/ui/apps/pmm/src/api/installToken.ts new file mode 100644 index 00000000000..f10d504394b --- /dev/null +++ b/ui/apps/pmm/src/api/installToken.ts @@ -0,0 +1,23 @@ +import { api } from './api'; +import { MANAGEMENT_CREATE_NODE_INSTALL_TOKEN } from './managementEndpoints'; + +export interface CreateNodeInstallTokenResponse { + token: string; + expiresAt?: string; + serviceAccountId?: string; +} + +/** Mints a short-lived Grafana token for PMM Client install (admin session). */ +export async function createNodeInstallToken( + technology: string, + ttlSeconds = 0 +): Promise { + return api.post( + MANAGEMENT_CREATE_NODE_INSTALL_TOKEN, + { + ttlSeconds, + technology, + }, + true + ); +} diff --git a/ui/apps/pmm/src/api/managementEndpoints.ts b/ui/apps/pmm/src/api/managementEndpoints.ts new file mode 100644 index 00000000000..90ced557e3b --- /dev/null +++ b/ui/apps/pmm/src/api/managementEndpoints.ts @@ -0,0 +1,2 @@ +/** Path segment relative to axios `baseURL` `/v1/` (see api.ts). */ +export const MANAGEMENT_CREATE_NODE_INSTALL_TOKEN = 'management/nodes:installToken'; diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index 90f178eaeb4..08124b785bc 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -1,3 +1,4 @@ +import axios from 'axios'; import { useMemo, useState } from 'react'; import { Alert, @@ -16,8 +17,10 @@ import { Typography, } from '@mui/material'; import { Page } from 'components/page'; +import { createNodeInstallToken } from 'api/installToken'; import { buildInstallCommand, + buildPmmServerURL, CredentialsMode, Technology, } from './InstallClientPage.utils'; @@ -39,18 +42,15 @@ export const InstallClientPage = () => { const [dbAuthDB, setDbAuthDB] = useState(''); const [dbServiceName, setDbServiceName] = useState(''); const [copied, setCopied] = useState(false); + const [genLoading, setGenLoading] = useState(false); + const [genError, setGenError] = useState(null); const installerUrl = useMemo( () => `${window.location.origin}/pmm-static/install-pmm-client.sh`, [] ); - const serverURL = useMemo(() => { - if (!token.trim()) { - return `https://service_token:@${pmmHost || ''}:443`; - } - return `https://service_token:${token.trim()}@${pmmHost || 'localhost'}:443`; - }, [token, pmmHost]); + const serverURL = useMemo(() => buildPmmServerURL(pmmHost, token), [pmmHost, token]); const command = useMemo( () => @@ -96,6 +96,24 @@ export const InstallClientPage = () => { window.setTimeout(() => setCopied(false), 2000); }; + const handleGenerateToken = async () => { + setGenError(null); + setGenLoading(true); + try { + const res = await createNodeInstallToken(technology, 0); + setToken(res.token); + } catch (e: unknown) { + let msg = 'Failed to create token'; + if (axios.isAxiosError(e)) { + const data = e.response?.data as { message?: string } | undefined; + msg = data?.message ?? e.message; + } + setGenError(msg); + } finally { + setGenLoading(false); + } + }; + return ( @@ -145,7 +163,7 @@ export const InstallClientPage = () => { label="PMM host" value={pmmHost} onChange={(e) => setPmmHost(e.target.value)} - helperText="Used to build PMM_SERVER_URL" + helperText="Hostname or hostname:port for PMM_SERVER_URL (defaults to this page if empty)" /> { helperText="Used only to render command locally in browser" /> + + + {genError && ( + + {genError} + + )} + { + test('uses placeholder when token empty', () => { + expect(buildPmmServerURL('pmm.example.com:8443', '')).toBe( + 'https://service_token:@pmm.example.com:8443' + ); + }); + + test('percent-encodes token in userinfo', () => { + expect(buildPmmServerURL('h:1', 'a:b@c')).toBe( + 'https://service_token:a%3Ab%40c@h:1' + ); + }); +}); + describe('buildInstallCommand', () => { test('omits DB password in prompt mode', () => { const cmd = buildInstallCommand(baseOptions); diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts index 1294ee12743..7e43a41ff94 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts @@ -1,6 +1,21 @@ export type Technology = 'mysql' | 'postgresql' | 'mongodb' | 'valkey'; export type CredentialsMode = 'prompt' | 'env' | 'flags'; +/** + * Builds PMM_SERVER_URL for install scripts. Token is percent-encoded in the userinfo. + * `pmmHost` is hostname or hostname:port (defaults to current page host when empty). + */ +export function buildPmmServerURL(pmmHost: string, token: string): string { + const authority = + pmmHost.trim() || + (typeof window !== 'undefined' ? window.location.host : 'localhost'); + const t = token.trim(); + if (!t) { + return `https://service_token:@${authority}`; + } + return `https://service_token:${encodeURIComponent(t)}@${authority}`; +} + export interface InstallCommandOptions { installerUrl: string; technology: Technology; From 690c7de3b99f4e38fbff2be2f444188be988f72e Mon Sep 17 00:00:00 2001 From: theTibi Date: Wed, 15 Apr 2026 08:05:36 +0200 Subject: [PATCH 03/36] Refactor createNodeInstallToken function in installToken.ts - Simplified the implementation of the createNodeInstallToken function by directly returning the response data from the API call. - Removed unnecessary parameters in the API post method for cleaner code. These changes enhance code readability and maintainability. --- ui/apps/pmm/src/api/installToken.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ui/apps/pmm/src/api/installToken.ts b/ui/apps/pmm/src/api/installToken.ts index f10d504394b..2d8b98e86a0 100644 --- a/ui/apps/pmm/src/api/installToken.ts +++ b/ui/apps/pmm/src/api/installToken.ts @@ -12,12 +12,9 @@ export async function createNodeInstallToken( technology: string, ttlSeconds = 0 ): Promise { - return api.post( - MANAGEMENT_CREATE_NODE_INSTALL_TOKEN, - { - ttlSeconds, - technology, - }, - true - ); + const res = await api.post(MANAGEMENT_CREATE_NODE_INSTALL_TOKEN, { + ttlSeconds, + technology, + }); + return res.data; } From 53b918d82b533d85a816ba1a32f520b0caa7c439 Mon Sep 17 00:00:00 2001 From: theTibi Date: Thu, 16 Apr 2026 09:09:13 +0300 Subject: [PATCH 04/36] Update PMM client installation script and UI components - Modified `install-pmm-client.sh` to enhance command options for node registration and configuration, including clearer error messages and improved handling of non-interactive installations. - Updated the UI to set `insecureTLS` to true by default and adjusted related tests to reflect this change. - Refactored command building logic in `InstallClientPage.utils.ts` to streamline the installation command generation, ensuring proper handling of flags and environment variables. These changes improve the installation process and user experience for the PMM client. --- .../roles/nginx/files/install-pmm-client.sh | 121 +++++++++++++----- .../install-client/InstallClientPage.tsx | 2 +- .../InstallClientPage.utils.test.ts | 18 ++- .../install-client/InstallClientPage.utils.ts | 48 ++++--- 4 files changed, 137 insertions(+), 52 deletions(-) diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh index b959f1eeba3..13dda97c3be 100644 --- a/build/ansible/roles/nginx/files/install-pmm-client.sh +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -19,9 +19,9 @@ Global options: --pmm-server-url URL PMM server URL (supports service_token userinfo) --pmm-server-insecure-tls Use --server-insecure-tls for pmm-admin config --tech TECH One of: mysql, postgresql, mongodb, valkey - --node-name NAME Node name for pmm-admin register - --node-address ADDRESS Node address for pmm-admin register - --register-force Re-register node with --force + --node-name NAME Node name for pmm-admin config + --node-address ADDRESS Node address for pmm-admin config + --force Pass --force to pmm-admin config (removes existing node name and its services on the server, then registers again) Generic DB options (mapped per technology): --db-user USER @@ -44,7 +44,7 @@ PMM_SERVER_INSECURE_TLS="${PMM_SERVER_INSECURE_TLS:-0}" TECH="${TECH:-}" NODE_NAME="${NODE_NAME:-}" NODE_ADDRESS="${NODE_ADDRESS:-}" -PMM_REGISTER_FORCE="${PMM_REGISTER_FORCE:-0}" +PMM_CONFIG_FORCE="${PMM_CONFIG_FORCE:-0}" DB_USER="${DB_USER:-}" DB_PASSWORD="${DB_PASSWORD:-}" @@ -116,8 +116,8 @@ while [[ $# -gt 0 ]]; do NODE_ADDRESS="${2:-}" shift 2 ;; - --register-force) - PMM_REGISTER_FORCE=1 + --force) + PMM_CONFIG_FORCE=1 shift ;; --db-user) @@ -164,7 +164,7 @@ done require_root() { if [[ "${EUID}" -ne 0 ]]; then - error "Run this script as root (for package installation). Example: curl ... | sudo env ... bash" + error "Run this script as root (for package installation). Example: curl -fsSLk ... | sudo -E env ... bash -s --" fi } @@ -172,6 +172,7 @@ prompt_if_empty() { local var_name="$1" local prompt_label="$2" local secret="${3:-0}" + local hint="${4:-}" local value="${!var_name:-}" if [[ -n "${value}" ]]; then @@ -186,14 +187,42 @@ prompt_if_empty() { fi if [[ -z "${value}" ]]; then - error "${prompt_label} is required." + if [[ -n "${hint}" ]]; then + error "${prompt_label} is required. ${hint}" + else + error "${prompt_label} is required." + fi fi printf -v "${var_name}" '%s' "${value}" } detect_os_family() { - if [[ -f /etc/redhat-release ]] || [[ -f /etc/centos-release ]]; then + if [[ -f /etc/os-release ]]; then + # shellcheck source=/dev/null + . /etc/os-release + case "${ID:-}" in + debian|ubuntu|linuxmint|kali|pop|astra) + echo "debian" + return + ;; + fedora|rhel|centos|rocky|almalinux|ol|amzn|virtuozzo|vzlinux|mageia) + echo "el" + return + ;; + esac + case ",${ID_LIKE:-}," in + *,debian*|*,ubuntu*) + echo "debian" + return + ;; + *,rhel*|*,fedora*|*,centos*) + echo "el" + return + ;; + esac + fi + if [[ -f /etc/redhat-release ]] || [[ -f /etc/centos-release ]] || [[ -f /etc/fedora-release ]]; then echo "el" return fi @@ -201,7 +230,7 @@ detect_os_family() { echo "debian" return fi - error "Unsupported OS. Supported families: RHEL/CentOS/Rocky/Oracle Linux and Debian/Ubuntu." + error "Unsupported OS. Supported families: RHEL/CentOS/Rocky/Fedora/Amazon Linux/Oracle Linux (RPM) and Debian/Ubuntu (DEB)." } install_percona_repo_el() { @@ -256,10 +285,47 @@ install_pmm_client() { apt-get install -y pmm-client } +# When stdin is not a terminal (e.g. curl ... | bash), prompts cannot be used for DB +# credentials. Fail before pmm-admin config so we do not register the node and then fail on add. +require_db_creds_before_config_if_noninteractive() { + if [[ -t 0 ]]; then + return 0 + fi + + apply_generic_inputs + + local hint='This install is non-interactive (stdin is not a terminal, e.g. curl ... | bash), so database credentials cannot be prompted. Set them before the agent registers with PMM Server: use --db-user and --db-password, or DB_USER and DB_PASSWORD (include them in sudo env if you use sudo env; use sudo -E to preserve exports).' + + case "${TECH}" in + mysql) + if [[ -z "${MYSQL_USERNAME}" || -z "${MYSQL_PASSWORD}" ]]; then + error "MySQL username and password are required for non-interactive runs. ${hint}" + fi + ;; + postgresql) + if [[ -z "${POSTGRESQL_USERNAME}" || -z "${POSTGRESQL_PASSWORD}" ]]; then + error "PostgreSQL username and password are required for non-interactive runs. ${hint}" + fi + ;; + mongodb) + if [[ -z "${MONGODB_USERNAME}" || -z "${MONGODB_PASSWORD}" ]]; then + error "MongoDB username and password are required for non-interactive runs. ${hint}" + fi + ;; + valkey) + if [[ -z "${VALKEY_PASSWORD}" ]]; then + error "Valkey password is required for non-interactive runs (use --db-password or DB_PASSWORD / VALKEY_PASSWORD). ${hint}" + fi + ;; + esac +} + configure_pmm_agent() { prompt_if_empty PMM_SERVER_URL "PMM server URL (example: https://service_token:GLSA_TOKEN@pmm.example.com:443)" 1 prompt_if_empty TECH "Technology to add (mysql/postgresql/mongodb/valkey)" + require_db_creds_before_config_if_noninteractive + local config_cmd=(pmm-admin config "--server-url=${PMM_SERVER_URL}") if [[ "${PMM_SERVER_INSECURE_TLS}" == "1" || "${PMM_SERVER_INSECURE_TLS}" == "true" ]]; then config_cmd+=(--server-insecure-tls) @@ -270,23 +336,12 @@ configure_pmm_agent() { if [[ -n "${NODE_NAME}" ]]; then config_cmd+=("generic" "${NODE_NAME}") fi + if [[ "${PMM_CONFIG_FORCE}" == "1" || "${PMM_CONFIG_FORCE}" == "true" ]]; then + config_cmd+=(--force) + fi log "Running pmm-admin config..." "${config_cmd[@]}" - - local register_cmd=(pmm-admin register) - if [[ -n "${NODE_ADDRESS}" ]]; then - register_cmd+=("${NODE_ADDRESS}") - fi - if [[ -n "${NODE_NAME}" ]]; then - register_cmd+=("generic" "${NODE_NAME}") - fi - if [[ "${PMM_REGISTER_FORCE}" == "1" || "${PMM_REGISTER_FORCE}" == "true" ]]; then - register_cmd+=(--force) - fi - - log "Running pmm-admin register..." - "${register_cmd[@]}" } apply_generic_inputs() { @@ -335,8 +390,9 @@ apply_generic_inputs() { } add_mysql() { - prompt_if_empty MYSQL_USERNAME "MySQL username" - prompt_if_empty MYSQL_PASSWORD "MySQL password" 1 + local db_cred_hint='Use --db-user and --db-password, or set DB_USER and DB_PASSWORD (MYSQL_* overrides if set). If you use sudo env, list DB_USER and DB_PASSWORD there; exports in your shell are not passed to the script.' + prompt_if_empty MYSQL_USERNAME "MySQL username" 0 "${db_cred_hint}" + prompt_if_empty MYSQL_PASSWORD "MySQL password" 1 "${db_cred_hint}" MYSQL_ADDRESS="${MYSQL_ADDRESS:-${MYSQL_HOST:-127.0.0.1}:${MYSQL_PORT:-3306}}" MYSQL_SERVICE_NAME="${MYSQL_SERVICE_NAME:-$(hostname)-mysql}" local cmd=(pmm-admin add mysql "${MYSQL_SERVICE_NAME}" "${MYSQL_ADDRESS}" "--username=${MYSQL_USERNAME}" "--password=${MYSQL_PASSWORD}") @@ -348,8 +404,9 @@ add_mysql() { } add_postgresql() { - prompt_if_empty POSTGRESQL_USERNAME "PostgreSQL username" - prompt_if_empty POSTGRESQL_PASSWORD "PostgreSQL password" 1 + local db_cred_hint='Use --db-user and --db-password, or set DB_USER and DB_PASSWORD (POSTGRESQL_* overrides if set). If you use sudo env, list DB_USER and DB_PASSWORD there; exports in your shell are not passed to the script.' + prompt_if_empty POSTGRESQL_USERNAME "PostgreSQL username" 0 "${db_cred_hint}" + prompt_if_empty POSTGRESQL_PASSWORD "PostgreSQL password" 1 "${db_cred_hint}" POSTGRESQL_ADDRESS="${POSTGRESQL_ADDRESS:-${POSTGRESQL_HOST:-127.0.0.1}:${POSTGRESQL_PORT:-5432}}" POSTGRESQL_SERVICE_NAME="${POSTGRESQL_SERVICE_NAME:-$(hostname)-postgresql}" local cmd=(pmm-admin add postgresql "${POSTGRESQL_SERVICE_NAME}" "${POSTGRESQL_ADDRESS}" "--username=${POSTGRESQL_USERNAME}" "--password=${POSTGRESQL_PASSWORD}") @@ -364,8 +421,9 @@ add_postgresql() { } add_mongodb() { - prompt_if_empty MONGODB_USERNAME "MongoDB username" - prompt_if_empty MONGODB_PASSWORD "MongoDB password" 1 + local db_cred_hint='Use --db-user and --db-password, or set DB_USER and DB_PASSWORD (MONGODB_* overrides if set). If you use sudo env, list DB_USER and DB_PASSWORD there; exports in your shell are not passed to the script.' + prompt_if_empty MONGODB_USERNAME "MongoDB username" 0 "${db_cred_hint}" + prompt_if_empty MONGODB_PASSWORD "MongoDB password" 1 "${db_cred_hint}" MONGODB_ADDRESS="${MONGODB_ADDRESS:-${MONGODB_HOST:-127.0.0.1}:${MONGODB_PORT:-27017}}" MONGODB_SERVICE_NAME="${MONGODB_SERVICE_NAME:-$(hostname)-mongodb}" local cmd=(pmm-admin add mongodb "${MONGODB_SERVICE_NAME}" "${MONGODB_ADDRESS}" "--username=${MONGODB_USERNAME}" "--password=${MONGODB_PASSWORD}") @@ -380,7 +438,8 @@ add_mongodb() { } add_valkey() { - prompt_if_empty VALKEY_PASSWORD "Valkey password" 1 + local db_cred_hint='Use --db-password or DB_PASSWORD (VALKEY_PASSWORD overrides if set). If you use sudo env, list DB_PASSWORD there; exports in your shell are not passed to the script.' + prompt_if_empty VALKEY_PASSWORD "Valkey password" 1 "${db_cred_hint}" VALKEY_ADDRESS="${VALKEY_ADDRESS:-${VALKEY_HOST:-127.0.0.1}:${VALKEY_PORT:-6379}}" VALKEY_SERVICE_NAME="${VALKEY_SERVICE_NAME:-$(hostname)-valkey}" local cmd=(pmm-admin add valkey "${VALKEY_SERVICE_NAME}" "${VALKEY_ADDRESS}" "--password=${VALKEY_PASSWORD}") diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index 08124b785bc..4bfababa56f 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -30,7 +30,7 @@ export const InstallClientPage = () => { const [credentialsMode, setCredentialsMode] = useState('prompt'); const [token, setToken] = useState(''); const [pmmHost, setPmmHost] = useState(() => window.location.host); - const [insecureTLS, setInsecureTLS] = useState(false); + const [insecureTLS, setInsecureTLS] = useState(true); const [registerForce, setRegisterForce] = useState(false); const [nodeName, setNodeName] = useState(''); const [nodeAddress, setNodeAddress] = useState(''); diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts index ca86094efcf..58cd612600d 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts @@ -10,7 +10,7 @@ const baseOptions: InstallCommandOptions = { technology: 'mysql', credentialsMode: 'prompt', serverURL: 'https://service_token:GLSA@pmm.example.com:443', - insecureTLS: false, + insecureTLS: true, registerForce: false, nodeName: '', nodeAddress: '', @@ -42,7 +42,16 @@ describe('buildInstallCommand', () => { const cmd = buildInstallCommand(baseOptions); expect(cmd).toContain("TECH='mysql'"); expect(cmd).not.toContain('DB_PASSWORD='); - expect(cmd).toContain('sudo env'); + expect(cmd).toContain('sudo -E env'); + expect(cmd).toContain('curl -fsSLk'); + expect(cmd).toContain('bash -s --'); + expect(cmd).toContain('--pmm-server-insecure-tls'); + }); + + test('omits insecure TLS flag when disabled', () => { + const cmd = buildInstallCommand({ ...baseOptions, insecureTLS: false }); + expect(cmd).not.toContain('--pmm-server-insecure-tls'); + expect(cmd).toContain('bash -s --'); }); test('includes DB credentials in env mode', () => { @@ -62,10 +71,13 @@ describe('buildInstallCommand', () => { technology: 'postgresql', dbName: 'postgres', }); - expect(cmd).toContain('sudo bash -s --'); + expect(cmd).toContain('sudo -E bash -s --'); + expect(cmd).toContain('curl -fsSLk'); + expect(cmd).toContain("--pmm-server-url 'https://service_token:GLSA@pmm.example.com:443'"); expect(cmd).toContain("--tech 'postgresql'"); expect(cmd).toContain("--db-password 'secret'"); expect(cmd).toContain("--db-name 'postgres'"); + expect(cmd).toContain('--pmm-server-insecure-tls'); }); test('includes mongodb auth db only for mongodb', () => { diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts index 7e43a41ff94..116fdfc7797 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts @@ -38,17 +38,13 @@ export const shellEscape = (value: string): string => `'${value.replace(/'/g, `'\\''`)}'`; export const buildInstallCommand = (opts: InstallCommandOptions): string => { + const curl = `curl -fsSLk ${shellEscape(opts.installerUrl)}`; + const envVars: string[] = [ `PMM_SERVER_URL=${shellEscape(opts.serverURL)}`, `TECH=${shellEscape(opts.technology)}`, ]; - if (opts.insecureTLS) { - envVars.push('PMM_SERVER_INSECURE_TLS=1'); - } - if (opts.registerForce) { - envVars.push('PMM_REGISTER_FORCE=1'); - } if (opts.nodeName.trim()) { envVars.push(`NODE_NAME=${shellEscape(opts.nodeName.trim())}`); } @@ -56,6 +52,15 @@ export const buildInstallCommand = (opts: InstallCommandOptions): string => { envVars.push(`NODE_ADDRESS=${shellEscape(opts.nodeAddress.trim())}`); } + /** Passed after \`bash -s --\` (matches install-pmm-client.sh). */ + const scriptFlags: string[] = []; + if (opts.insecureTLS) { + scriptFlags.push('--pmm-server-insecure-tls'); + } + if (opts.registerForce) { + scriptFlags.push('--force'); + } + if (opts.credentialsMode === 'env') { if (opts.dbUser.trim()) { envVars.push(`DB_USER=${shellEscape(opts.dbUser.trim())}`); @@ -81,7 +86,10 @@ export const buildInstallCommand = (opts: InstallCommandOptions): string => { } if (opts.credentialsMode === 'flags') { - const flags: string[] = [`--tech ${shellEscape(opts.technology)}`]; + const flags: string[] = [ + `--pmm-server-url ${shellEscape(opts.serverURL)}`, + `--tech ${shellEscape(opts.technology)}`, + ]; if (opts.nodeName.trim()) { flags.push(`--node-name ${shellEscape(opts.nodeName.trim())}`); @@ -93,7 +101,7 @@ export const buildInstallCommand = (opts: InstallCommandOptions): string => { flags.push('--pmm-server-insecure-tls'); } if (opts.registerForce) { - flags.push('--register-force'); + flags.push('--force'); } if (opts.dbUser.trim()) { flags.push(`--db-user ${shellEscape(opts.dbUser.trim())}`); @@ -118,17 +126,23 @@ export const buildInstallCommand = (opts: InstallCommandOptions): string => { } return [ - `curl -fsSL ${shellEscape(opts.installerUrl)} | sudo bash -s -- \\`, - ` --pmm-server-url ${shellEscape(opts.serverURL)} \\`, + `${curl} | sudo -E bash -s -- \\`, ` ${flags.join(' \\\n ')}`, ].join('\n'); } - return [ - `curl -fsSL ${shellEscape(opts.installerUrl)} | sudo env \\`, - ...envVars.map((item, index) => { - const suffix = index === envVars.length - 1 ? ' bash' : ' \\'; - return ` ${item}${suffix}`; - }), - ].join('\n'); + const lines: string[] = [`${curl} | sudo -E env \\`]; + envVars.forEach((item) => { + lines.push(` ${item} \\`); + }); + if (scriptFlags.length === 0) { + lines.push('bash -s --'); + } else { + lines.push('bash -s -- \\'); + scriptFlags.forEach((flag, index) => { + const isLast = index === scriptFlags.length - 1; + lines.push(isLast ? ` ${flag}` : ` ${flag} \\`); + }); + } + return lines.join('\n'); }; From 3f3124b730eb9c6c5d10ed45bc327f09ceead3a8 Mon Sep 17 00:00:00 2001 From: theTibi Date: Thu, 16 Apr 2026 09:09:23 +0300 Subject: [PATCH 05/36] Refactor OS detection in install-pmm-client.sh - Simplified the OS detection logic by removing unnecessary cases for various Linux distributions. - Updated the error message to clearly specify the supported 64-bit Linux distributions: Debian, Ubuntu (DEB) and RHEL, Oracle Linux, Amazon Linux (RPM). These changes enhance the clarity and maintainability of the installation script. --- .../roles/nginx/files/install-pmm-client.sh | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh index 13dda97c3be..05a0463d2e1 100644 --- a/build/ansible/roles/nginx/files/install-pmm-client.sh +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -202,27 +202,17 @@ detect_os_family() { # shellcheck source=/dev/null . /etc/os-release case "${ID:-}" in - debian|ubuntu|linuxmint|kali|pop|astra) + debian|ubuntu) echo "debian" return ;; - fedora|rhel|centos|rocky|almalinux|ol|amzn|virtuozzo|vzlinux|mageia) - echo "el" - return - ;; - esac - case ",${ID_LIKE:-}," in - *,debian*|*,ubuntu*) - echo "debian" - return - ;; - *,rhel*|*,fedora*|*,centos*) + rhel|ol|amzn) echo "el" return ;; esac fi - if [[ -f /etc/redhat-release ]] || [[ -f /etc/centos-release ]] || [[ -f /etc/fedora-release ]]; then + if [[ -f /etc/redhat-release ]] || [[ -f /etc/oracle-release ]]; then echo "el" return fi @@ -230,7 +220,7 @@ detect_os_family() { echo "debian" return fi - error "Unsupported OS. Supported families: RHEL/CentOS/Rocky/Fedora/Amazon Linux/Oracle Linux (RPM) and Debian/Ubuntu (DEB)." + error "Unsupported OS. Supported 64-bit Linux: Debian, Ubuntu (DEB) and RHEL, Oracle Linux, Amazon Linux (RPM)." } install_percona_repo_el() { From a77c25afb7b20fbfb59925711c8c6a8d32318c90 Mon Sep 17 00:00:00 2001 From: theTibi Date: Thu, 16 Apr 2026 15:24:28 +0300 Subject: [PATCH 06/36] Enhance Install Client Page and Command Generation - Updated the default credentials mode to 'env' for improved security during installation. - Enhanced user guidance in the UI regarding the use of environment variables and flags for database credentials. - Added new helper text to clarify the limitations of using curl with the installation script. - Modified the command generation logic to include database environment variables when applicable, improving the handling of optional database fields in both prompt and env modes. - Updated tests to ensure correct behavior when optional database fields are provided. These changes improve the user experience and security of the PMM client installation process. --- .../install-client/InstallClientPage.tsx | 26 +++++++++------ .../InstallClientPage.utils.test.ts | 33 +++++++++++++++---- .../install-client/InstallClientPage.utils.ts | 15 ++++++++- 3 files changed, 56 insertions(+), 18 deletions(-) diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index 4bfababa56f..daa4c56d599 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -8,6 +8,7 @@ import { CardContent, FormControl, FormControlLabel, + FormHelperText, InputLabel, MenuItem, Select, @@ -27,7 +28,7 @@ import { export const InstallClientPage = () => { const [technology, setTechnology] = useState('mysql'); - const [credentialsMode, setCredentialsMode] = useState('prompt'); + const [credentialsMode, setCredentialsMode] = useState('env'); const [token, setToken] = useState(''); const [pmmHost, setPmmHost] = useState(() => window.location.host); const [insecureTLS, setInsecureTLS] = useState(true); @@ -120,8 +121,10 @@ export const InstallClientPage = () => { - Choose installation options, then copy and run the generated command - on your database node. + Choose installation options, then copy and run the generated command on your database + node. The usual curl … | bash form has no interactive terminal on stdin, so + use env variables or flags for database credentials unless you save the script and run it + from a real shell. @@ -150,10 +153,17 @@ export const InstallClientPage = () => { setCredentialsMode(e.target.value as CredentialsMode) } > - Prompt on node (recommended) - Include env variables + Include env variables (recommended for curl | bash) Pass as script flags + + Prompt on node (TTY only — save script and run in a terminal, not curl | bash) + + + Piping from curl gives the script stdin, not your keyboard; prompts only work when + stdin is a terminal (e.g. download the script, then{' '} + sudo bash ./install-pmm-client.sh …). + @@ -207,7 +217,7 @@ export const InstallClientPage = () => { setDbUser(e.target.value)} /> @@ -299,10 +309,6 @@ export const InstallClientPage = () => { {copied && Command copied.} - - Passwords in command-line args or env vars may be visible in shell - history. Use prompt mode when possible. - diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts index 58cd612600d..9b35ac98d1f 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts @@ -14,12 +14,21 @@ const baseOptions: InstallCommandOptions = { registerForce: false, nodeName: '', nodeAddress: '', + dbUser: '', + dbPassword: '', + dbHost: '', + dbPort: '', + dbName: '', + dbAuthDB: '', + dbServiceName: '', +}; + +const optionsWithDb: InstallCommandOptions = { + ...baseOptions, dbUser: 'pmm', dbPassword: 'secret', dbHost: '127.0.0.1', dbPort: '3306', - dbName: '', - dbAuthDB: '', dbServiceName: 'node-mysql', }; @@ -38,16 +47,26 @@ describe('buildPmmServerURL', () => { }); describe('buildInstallCommand', () => { - test('omits DB password in prompt mode', () => { + test('omits DB env in prompt mode when DB fields are empty', () => { const cmd = buildInstallCommand(baseOptions); expect(cmd).toContain("TECH='mysql'"); expect(cmd).not.toContain('DB_PASSWORD='); + expect(cmd).not.toContain('DB_USER='); expect(cmd).toContain('sudo -E env'); expect(cmd).toContain('curl -fsSLk'); expect(cmd).toContain('bash -s --'); expect(cmd).toContain('--pmm-server-insecure-tls'); }); + test('includes DB env in prompt mode when optional DB fields are set', () => { + const cmd = buildInstallCommand(optionsWithDb); + expect(cmd).toContain("DB_USER='pmm'"); + expect(cmd).toContain("DB_PASSWORD='secret'"); + expect(cmd).toContain("DB_HOST='127.0.0.1'"); + expect(cmd).toContain("DB_PORT='3306'"); + expect(cmd).toContain("DB_SERVICE_NAME='node-mysql'"); + }); + test('omits insecure TLS flag when disabled', () => { const cmd = buildInstallCommand({ ...baseOptions, insecureTLS: false }); expect(cmd).not.toContain('--pmm-server-insecure-tls'); @@ -56,7 +75,7 @@ describe('buildInstallCommand', () => { test('includes DB credentials in env mode', () => { const cmd = buildInstallCommand({ - ...baseOptions, + ...optionsWithDb, credentialsMode: 'env', }); expect(cmd).toContain("DB_USER='pmm'"); @@ -66,7 +85,7 @@ describe('buildInstallCommand', () => { test('uses flags mode and includes db args', () => { const cmd = buildInstallCommand({ - ...baseOptions, + ...optionsWithDb, credentialsMode: 'flags', technology: 'postgresql', dbName: 'postgres', @@ -82,13 +101,13 @@ describe('buildInstallCommand', () => { test('includes mongodb auth db only for mongodb', () => { const mongodb = buildInstallCommand({ - ...baseOptions, + ...optionsWithDb, credentialsMode: 'env', technology: 'mongodb', dbAuthDB: 'admin', }); const mysql = buildInstallCommand({ - ...baseOptions, + ...optionsWithDb, credentialsMode: 'env', technology: 'mysql', dbAuthDB: 'admin', diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts index 116fdfc7797..c4db74cf3e7 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts @@ -61,7 +61,20 @@ export const buildInstallCommand = (opts: InstallCommandOptions): string => { scriptFlags.push('--force'); } - if (opts.credentialsMode === 'env') { + const emitDbEnvVars = + opts.credentialsMode === 'env' || + (opts.credentialsMode === 'prompt' && + Boolean( + opts.dbUser.trim() || + opts.dbPassword.trim() || + opts.dbHost.trim() || + opts.dbPort.trim() || + opts.dbServiceName.trim() || + opts.dbName.trim() || + opts.dbAuthDB.trim() + )); + + if (emitDbEnvVars) { if (opts.dbUser.trim()) { envVars.push(`DB_USER=${shellEscape(opts.dbUser.trim())}`); } From c7c3f156db7c9a36cf97b3ea4feebd891797912f Mon Sep 17 00:00:00 2001 From: theTibi Date: Wed, 29 Apr 2026 10:00:40 +0200 Subject: [PATCH 07/36] Add PMM agent runtime configuration and startup logic - Introduced environment variables for PMM agent configuration, allowing customization of the config file path, listen host, listen port, log file, and start timeout. - Implemented functions to ensure the PMM agent is running, handling both systemd and nohup startup methods. - Added checks to create the PMM agent config file if it does not exist, improving the robustness of the installation script. These changes enhance the installation process by ensuring the PMM agent is properly configured and running, especially in environments without systemd. Signed-off-by: theTibi --- .../roles/nginx/files/install-pmm-client.sh | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh index 05a0463d2e1..2389cc6107a 100644 --- a/build/ansible/roles/nginx/files/install-pmm-client.sh +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -36,6 +36,13 @@ Generic DB options (mapped per technology): Environment variables are also supported. Priority is: flags > env vars > interactive prompt. + +pmm-agent runtime knobs (env only): + PMM_AGENT_CONFIG_FILE Path to pmm-agent.yaml (default: /usr/local/percona/pmm/config/pmm-agent.yaml) + PMM_AGENT_LISTEN_HOST Host the local API binds to (default: 127.0.0.1) + PMM_AGENT_LISTEN_PORT Port the local API binds to (default: 7777) + PMM_AGENT_LOG_FILE Log file when started without systemd (default: /var/log/pmm-agent.log) + PMM_AGENT_START_TIMEOUT_SECS Seconds to wait for the local API after start (default: 30) EOF } @@ -90,6 +97,15 @@ VALKEY_ADDRESS="${VALKEY_ADDRESS:-}" VALKEY_SERVICE_NAME="${VALKEY_SERVICE_NAME:-}" VALKEY_SOCKET="${VALKEY_SOCKET:-}" +# pmm-agent runtime knobs. Defaults match the Debian/RPM package layout. +# Override via env if the package places things elsewhere or you need to +# bind the local API on a non-default host/port. +PMM_AGENT_CONFIG_FILE="${PMM_AGENT_CONFIG_FILE:-/usr/local/percona/pmm/config/pmm-agent.yaml}" +PMM_AGENT_LISTEN_HOST="${PMM_AGENT_LISTEN_HOST:-127.0.0.1}" +PMM_AGENT_LISTEN_PORT="${PMM_AGENT_LISTEN_PORT:-7777}" +PMM_AGENT_LOG_FILE="${PMM_AGENT_LOG_FILE:-/var/log/pmm-agent.log}" +PMM_AGENT_START_TIMEOUT_SECS="${PMM_AGENT_START_TIMEOUT_SECS:-30}" + while [[ $# -gt 0 ]]; do case "$1" in --help|-h) @@ -275,6 +291,110 @@ install_pmm_client() { apt-get install -y pmm-client } +# Returns 0 if a real systemd is the init (i.e. systemctl can actually start units). +# Mere presence of systemctl is not enough — Docker images often ship the binary +# without PID 1 being systemd, and `systemctl start` then no-ops or fails. +systemd_is_running() { + [[ -d /run/systemd/system ]] && command -v systemctl >/dev/null 2>&1 +} + +# Cheap TCP probe via bash builtins; no curl/nc dependency. We only need to know +# the local API socket is bound — pmm-admin will do the actual HTTP handshake. +pmm_agent_listening() { + (exec 3<>"/dev/tcp/${PMM_AGENT_LISTEN_HOST}/${PMM_AGENT_LISTEN_PORT}") >/dev/null 2>&1 && { + exec 3>&- 3<&- + return 0 + } + return 1 +} + +wait_for_pmm_agent() { + local i + for ((i = 0; i < PMM_AGENT_START_TIMEOUT_SECS; i++)); do + if pmm_agent_listening; then + return 0 + fi + sleep 1 + done + return 1 +} + +# pmm-agent refuses to start without a config file. The Debian/RPM packages +# create an empty 0660 file at install time; recreate it if something deleted it +# (e.g. after a manual cleanup) so the daemon at least has a path to write to. +ensure_pmm_agent_config_file() { + local dir + dir="$(dirname "${PMM_AGENT_CONFIG_FILE}")" + if [[ ! -d "${dir}" ]]; then + mkdir -p "${dir}" + fi + if [[ ! -e "${PMM_AGENT_CONFIG_FILE}" ]]; then + : > "${PMM_AGENT_CONFIG_FILE}" + chmod 0660 "${PMM_AGENT_CONFIG_FILE}" || true + log "Created empty pmm-agent config: ${PMM_AGENT_CONFIG_FILE}" + fi +} + +start_pmm_agent_systemd() { + if ! systemctl list-unit-files pmm-agent.service >/dev/null 2>&1; then + return 1 + fi + log "Starting pmm-agent via systemd..." + systemctl daemon-reload >/dev/null 2>&1 || true + systemctl enable --now pmm-agent.service +} + +start_pmm_agent_nohup() { + if ! command -v pmm-agent >/dev/null 2>&1; then + error "pmm-agent binary not found in PATH; cannot start it manually." + fi + mkdir -p "$(dirname "${PMM_AGENT_LOG_FILE}")" 2>/dev/null || true + log "Starting pmm-agent in the background (no usable systemd); logging to ${PMM_AGENT_LOG_FILE}" + nohup pmm-agent --config-file="${PMM_AGENT_CONFIG_FILE}" \ + >>"${PMM_AGENT_LOG_FILE}" 2>&1 & + disown 2>/dev/null || true +} + +# Make sure pmm-agent is up and listening on its local API before we hand off to +# pmm-admin config/add. The script previously assumed the package's postinst had +# already started the daemon via systemd; that breaks in containers (no systemd) +# and on hosts where the service is masked or stopped. +ensure_pmm_agent_running() { + if pmm_agent_listening; then + log "pmm-agent already listening on ${PMM_AGENT_LISTEN_HOST}:${PMM_AGENT_LISTEN_PORT}." + return + fi + + log "pmm-agent is not running; attempting to start it." + ensure_pmm_agent_config_file + + local started=0 + if systemd_is_running; then + if start_pmm_agent_systemd; then + started=1 + else + log "No pmm-agent.service unit found; falling back to nohup." + fi + fi + + if [[ "${started}" -eq 0 ]]; then + start_pmm_agent_nohup + fi + + if ! wait_for_pmm_agent; then + log "pmm-agent did not bind ${PMM_AGENT_LISTEN_HOST}:${PMM_AGENT_LISTEN_PORT} within ${PMM_AGENT_START_TIMEOUT_SECS}s." + if [[ -f "${PMM_AGENT_LOG_FILE}" ]]; then + log "Last 20 lines of ${PMM_AGENT_LOG_FILE}:" + tail -n 20 "${PMM_AGENT_LOG_FILE}" >&2 || true + elif systemd_is_running; then + log "Try: journalctl -u pmm-agent -n 50 --no-pager" + fi + error "pmm-agent failed to start." + fi + + log "pmm-agent is up on ${PMM_AGENT_LISTEN_HOST}:${PMM_AGENT_LISTEN_PORT}." +} + # When stdin is not a terminal (e.g. curl ... | bash), prompts cannot be used for DB # credentials. Fail before pmm-admin config so we do not register the node and then fail on add. require_db_creds_before_config_if_noninteractive() { @@ -468,6 +588,7 @@ add_service() { main() { require_root install_pmm_client + ensure_pmm_agent_running configure_pmm_agent add_service log "PMM client setup completed successfully." From 3abcf8b4ed7e0fd869879ffefe274e61c4e7e489 Mon Sep 17 00:00:00 2001 From: theTibi Date: Wed, 29 Apr 2026 11:14:02 +0200 Subject: [PATCH 08/36] Enhance Install Token Management and UI Experience - Updated the default lifetime of install tokens to 15 minutes for improved security, reflecting the short-lived nature of tokens used during the initial configuration. - Modified the `InstallClientPage` to include a countdown timer for token expiration, enhancing user awareness of token validity. - Added helper text to clarify the implications of token expiration and the need for regeneration. - Introduced a new utility function `formatExpiresIn` to format the remaining time of the token, improving the display of expiration information. - Updated tests to ensure correct functionality of the new token management features. These changes improve the security and usability of the PMM client installation process. Signed-off-by: theTibi --- managed/services/management/install_token.go | 11 ++- .../services/management/install_token_test.go | 2 +- .../install-client/InstallClientPage.tsx | 94 +++++++++++++++++-- .../InstallClientPage.utils.test.ts | 30 ++++++ .../install-client/InstallClientPage.utils.ts | 12 +++ 5 files changed, 136 insertions(+), 13 deletions(-) diff --git a/managed/services/management/install_token.go b/managed/services/management/install_token.go index add90c9338f..393a15b95bd 100644 --- a/managed/services/management/install_token.go +++ b/managed/services/management/install_token.go @@ -28,10 +28,15 @@ import ( managementv1 "github.com/percona/pmm/api/management/v1" ) +// Install-token lifetime is intentionally short: the token is only used for the +// initial pmm-admin config handshake, after which pmm-agent stores its own +// per-agent identity and no longer needs it. A 15-minute window covers normal +// install runs while limiting damage if the URL leaks (the token is admin-role +// on Grafana, so treat it like a password). const ( - defaultInstallTokenTTLSeconds = int64(86400) - maxInstallTokenTTLSeconds = int64(86400) - minInstallTokenTTLSeconds = int64(60) + defaultInstallTokenTTLSeconds = int64(15 * 60) // 15 minutes + maxInstallTokenTTLSeconds = int64(15 * 60) // 15 minutes; hard cap, no caller can exceed + minInstallTokenTTLSeconds = int64(60) // 1 minute floor to leave room for slow installs ) var installTokenTechnologies = map[string]struct{}{ diff --git a/managed/services/management/install_token_test.go b/managed/services/management/install_token_test.go index 11cc2a1e370..30895ae84cf 100644 --- a/managed/services/management/install_token_test.go +++ b/managed/services/management/install_token_test.go @@ -38,7 +38,7 @@ func TestManagementService_CreateNodeInstallToken(t *testing.T) { t.Run("ok", func(t *testing.T) { t.Parallel() gc := &mockGrafanaClient{} - gc.On("CreateNodeInstallToken", mock.Anything, mock.MatchedBy(func(s string) bool { return s != "" }), int64(86400)). + gc.On("CreateNodeInstallToken", mock.Anything, mock.MatchedBy(func(s string) bool { return s != "" }), defaultInstallTokenTTLSeconds). Return(int64(42), "tok", exp, nil).Once() s := &ManagementService{grafanaClient: gc} diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index daa4c56d599..a513a630423 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -1,11 +1,12 @@ import axios from 'axios'; -import { useMemo, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import { Alert, Box, Button, Card, CardContent, + Chip, FormControl, FormControlLabel, FormHelperText, @@ -17,12 +18,14 @@ import { TextField, Typography, } from '@mui/material'; +import AccessTimeOutlinedIcon from '@mui/icons-material/AccessTimeOutlined'; import { Page } from 'components/page'; import { createNodeInstallToken } from 'api/installToken'; import { buildInstallCommand, buildPmmServerURL, CredentialsMode, + formatExpiresIn, Technology, } from './InstallClientPage.utils'; @@ -45,6 +48,30 @@ export const InstallClientPage = () => { const [copied, setCopied] = useState(false); const [genLoading, setGenLoading] = useState(false); const [genError, setGenError] = useState(null); + const [tokenExpiresAt, setTokenExpiresAt] = useState(null); + const [now, setNow] = useState(() => Date.now()); + + // Tick once a second while a token is live, so the countdown chip refreshes. + // Stops as soon as expiresAt is null (e.g. user cleared the field manually). + useEffect(() => { + if (!tokenExpiresAt) return undefined; + const id = window.setInterval(() => setNow(Date.now()), 1000); + return () => window.clearInterval(id); + }, [tokenExpiresAt]); + + const secondsLeft = tokenExpiresAt + ? Math.max(0, Math.floor((tokenExpiresAt.getTime() - now) / 1000)) + : 0; + const isExpired = !!tokenExpiresAt && secondsLeft <= 0; + + // When the timer hits zero, drop the secret so the rendered command falls + // back to the placeholder. We deliberately keep `tokenExpiresAt` set so the + // chip can still show "Expired — regenerate" until the user acts. + useEffect(() => { + if (isExpired && token) { + setToken(''); + } + }, [isExpired, token]); const installerUrl = useMemo( () => `${window.location.origin}/pmm-static/install-pmm-client.sh`, @@ -103,6 +130,14 @@ export const InstallClientPage = () => { try { const res = await createNodeInstallToken(technology, 0); setToken(res.token); + // Server enforces a 15-minute hard cap (see install_token.go). If the + // response unexpectedly omits expiresAt, fall back to "now + 15 min" so + // the countdown still works and we don't silently lose the safety net. + const expires = res.expiresAt + ? new Date(res.expiresAt) + : new Date(Date.now() + 15 * 60 * 1000); + setTokenExpiresAt(expires); + setNow(Date.now()); } catch (e: unknown) { let msg = 'Failed to create token'; if (axios.isAxiosError(e)) { @@ -121,10 +156,16 @@ export const InstallClientPage = () => { - Choose installation options, then copy and run the generated command on your database - node. The usual curl … | bash form has no interactive terminal on stdin, so - use env variables or flags for database credentials unless you save the script and run it - from a real shell. + + Choose installation options, then copy and run the generated command on your database + node. The usual curl … | bash form has no interactive terminal on stdin, + so use env variables or flags for database credentials unless you save the script and + run it from a real shell. + + + Generated tokens are admin-role and valid for 15 minutes — treat the + URL like a password. + @@ -180,24 +221,59 @@ export const InstallClientPage = () => { type="password" label="Service token" value={token} - onChange={(e) => setToken(e.target.value)} - helperText="Used only to render command locally in browser" + onChange={(e) => { + setToken(e.target.value); + // User edited the field manually — drop the expiry so we + // stop ticking against a token they overrode. + setTokenExpiresAt(null); + }} + error={isExpired} + helperText={ + isExpired + ? 'Token expired. Click Regenerate to mint a new one.' + : 'Used only to render command locally in browser. Generated tokens auto-expire 15 min after creation.' + } /> - + + {tokenExpiresAt && !genLoading && ( + } + label={ + isExpired + ? 'Expired — regenerate' + : `Expires in ${formatExpiresIn(secondsLeft)}` + } + color={isExpired ? 'error' : 'success'} + variant="outlined" + size="medium" + /> + )} {genError && ( {genError} )} + + Tokens are valid for 15 minutes after generation. Run the command on your node before + then. + { expect(cmd).toContain("TECH='valkey'"); }); }); + +describe('formatExpiresIn', () => { + test('formats whole minutes with zero seconds', () => { + expect(formatExpiresIn(15 * 60)).toBe('15:00'); + expect(formatExpiresIn(60)).toBe('1:00'); + }); + + test('zero-pads seconds', () => { + expect(formatExpiresIn(125)).toBe('2:05'); + expect(formatExpiresIn(9)).toBe('0:09'); + }); + + test('handles boundary values', () => { + expect(formatExpiresIn(0)).toBe('0:00'); + expect(formatExpiresIn(1)).toBe('0:01'); + expect(formatExpiresIn(59)).toBe('0:59'); + expect(formatExpiresIn(60)).toBe('1:00'); + }); + + test('floors fractional seconds', () => { + expect(formatExpiresIn(59.9)).toBe('0:59'); + expect(formatExpiresIn(120.4)).toBe('2:00'); + }); + + test('clamps negatives to 0:00 (already expired)', () => { + expect(formatExpiresIn(-1)).toBe('0:00'); + expect(formatExpiresIn(-9999)).toBe('0:00'); + }); +}); diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts index c4db74cf3e7..f23544efcc7 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts @@ -1,6 +1,18 @@ export type Technology = 'mysql' | 'postgresql' | 'mongodb' | 'valkey'; export type CredentialsMode = 'prompt' | 'env' | 'flags'; +/** + * Formats the remaining lifetime of an install token as MM:SS. + * Negative inputs (already expired) are clamped to "0:00" so callers can + * branch on isExpired separately without seeing odd negative timers. + */ +export const formatExpiresIn = (secondsLeft: number): string => { + const safe = Math.max(0, Math.floor(secondsLeft)); + const minutes = Math.floor(safe / 60); + const seconds = safe % 60; + return `${minutes}:${seconds.toString().padStart(2, '0')}`; +}; + /** * Builds PMM_SERVER_URL for install scripts. Token is percent-encoded in the userinfo. * `pmmHost` is hostname or hostname:port (defaults to current page host when empty). From 7be45bda1de4b635533561745edae1f5e5cd93d8 Mon Sep 17 00:00:00 2001 From: theTibi Date: Wed, 29 Apr 2026 11:52:50 +0200 Subject: [PATCH 09/36] Enhance hostname detection in install-pmm-client.sh - Added a new function `detect_node_hostname` to resolve the local node's hostname without relying on the `hostname` command, improving compatibility with minimal RHEL/UBI/Alpine images. - Updated service name assignments for MySQL, PostgreSQL, MongoDB, and Valkey to use the new hostname detection function, ensuring accurate service naming. These changes enhance the robustness of the PMM client installation script in diverse environments. Signed-off-by: theTibi --- .../roles/nginx/files/install-pmm-client.sh | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh index 2389cc6107a..72c417db48f 100644 --- a/build/ansible/roles/nginx/files/install-pmm-client.sh +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -322,6 +322,31 @@ wait_for_pmm_agent() { # pmm-agent refuses to start without a config file. The Debian/RPM packages # create an empty 0660 file at install time; recreate it if something deleted it # (e.g. after a manual cleanup) so the daemon at least has a path to write to. +# Resolve the local node's hostname without assuming the `hostname(1)` binary +# is installed. Minimal RHEL/UBI/Alpine images often ship without it, and a +# `$(hostname)` call there fails with "command not found", which under +# `set -euo pipefail` aborts the whole script. Order: bash's $HOSTNAME (set +# automatically via gethostname() syscall) → uname -n → /etc/hostname → "node". +detect_node_hostname() { + if [[ -n "${HOSTNAME:-}" ]]; then + printf '%s' "${HOSTNAME}" + return + fi + if command -v hostname >/dev/null 2>&1; then + hostname + return + fi + if command -v uname >/dev/null 2>&1; then + uname -n + return + fi + if [[ -r /etc/hostname ]]; then + head -n 1 /etc/hostname + return + fi + printf 'node' +} + ensure_pmm_agent_config_file() { local dir dir="$(dirname "${PMM_AGENT_CONFIG_FILE}")" @@ -504,7 +529,7 @@ add_mysql() { prompt_if_empty MYSQL_USERNAME "MySQL username" 0 "${db_cred_hint}" prompt_if_empty MYSQL_PASSWORD "MySQL password" 1 "${db_cred_hint}" MYSQL_ADDRESS="${MYSQL_ADDRESS:-${MYSQL_HOST:-127.0.0.1}:${MYSQL_PORT:-3306}}" - MYSQL_SERVICE_NAME="${MYSQL_SERVICE_NAME:-$(hostname)-mysql}" + MYSQL_SERVICE_NAME="${MYSQL_SERVICE_NAME:-$(detect_node_hostname)-mysql}" local cmd=(pmm-admin add mysql "${MYSQL_SERVICE_NAME}" "${MYSQL_ADDRESS}" "--username=${MYSQL_USERNAME}" "--password=${MYSQL_PASSWORD}") if [[ -n "${MYSQL_SOCKET}" ]]; then cmd+=("--socket=${MYSQL_SOCKET}") @@ -518,7 +543,7 @@ add_postgresql() { prompt_if_empty POSTGRESQL_USERNAME "PostgreSQL username" 0 "${db_cred_hint}" prompt_if_empty POSTGRESQL_PASSWORD "PostgreSQL password" 1 "${db_cred_hint}" POSTGRESQL_ADDRESS="${POSTGRESQL_ADDRESS:-${POSTGRESQL_HOST:-127.0.0.1}:${POSTGRESQL_PORT:-5432}}" - POSTGRESQL_SERVICE_NAME="${POSTGRESQL_SERVICE_NAME:-$(hostname)-postgresql}" + POSTGRESQL_SERVICE_NAME="${POSTGRESQL_SERVICE_NAME:-$(detect_node_hostname)-postgresql}" local cmd=(pmm-admin add postgresql "${POSTGRESQL_SERVICE_NAME}" "${POSTGRESQL_ADDRESS}" "--username=${POSTGRESQL_USERNAME}" "--password=${POSTGRESQL_PASSWORD}") if [[ -n "${POSTGRESQL_DATABASE}" ]]; then cmd+=("--database=${POSTGRESQL_DATABASE}") @@ -535,7 +560,7 @@ add_mongodb() { prompt_if_empty MONGODB_USERNAME "MongoDB username" 0 "${db_cred_hint}" prompt_if_empty MONGODB_PASSWORD "MongoDB password" 1 "${db_cred_hint}" MONGODB_ADDRESS="${MONGODB_ADDRESS:-${MONGODB_HOST:-127.0.0.1}:${MONGODB_PORT:-27017}}" - MONGODB_SERVICE_NAME="${MONGODB_SERVICE_NAME:-$(hostname)-mongodb}" + MONGODB_SERVICE_NAME="${MONGODB_SERVICE_NAME:-$(detect_node_hostname)-mongodb}" local cmd=(pmm-admin add mongodb "${MONGODB_SERVICE_NAME}" "${MONGODB_ADDRESS}" "--username=${MONGODB_USERNAME}" "--password=${MONGODB_PASSWORD}") if [[ -n "${MONGODB_AUTH_DB}" ]]; then cmd+=("--authentication-database=${MONGODB_AUTH_DB}") @@ -551,7 +576,7 @@ add_valkey() { local db_cred_hint='Use --db-password or DB_PASSWORD (VALKEY_PASSWORD overrides if set). If you use sudo env, list DB_PASSWORD there; exports in your shell are not passed to the script.' prompt_if_empty VALKEY_PASSWORD "Valkey password" 1 "${db_cred_hint}" VALKEY_ADDRESS="${VALKEY_ADDRESS:-${VALKEY_HOST:-127.0.0.1}:${VALKEY_PORT:-6379}}" - VALKEY_SERVICE_NAME="${VALKEY_SERVICE_NAME:-$(hostname)-valkey}" + VALKEY_SERVICE_NAME="${VALKEY_SERVICE_NAME:-$(detect_node_hostname)-valkey}" local cmd=(pmm-admin add valkey "${VALKEY_SERVICE_NAME}" "${VALKEY_ADDRESS}" "--password=${VALKEY_PASSWORD}") if [[ -n "${VALKEY_USERNAME}" ]]; then cmd+=("--username=${VALKEY_USERNAME}") From d435861e0756a3cb57fa50002cb3efe6383a1287 Mon Sep 17 00:00:00 2001 From: theTibi Date: Wed, 29 Apr 2026 12:58:18 +0200 Subject: [PATCH 10/36] Enhance Node Install Token Management and Testing - Refactored the `CreateNodeInstallToken` function to accept a technology parameter instead of a unique suffix, improving clarity and usability. - Implemented validation for technology input, ensuring it is not empty and normalizing casing and whitespace. - Updated tests to cover new validation logic and ensure correct behavior for various technology inputs, including error handling for invalid and empty cases. - Enhanced the `install_token.go` file to maintain consistency with the updated function signature and logic. These changes improve the robustness and reliability of the node installation token management process. Signed-off-by: theTibi --- api-tests/management/nodes_test.go | 67 ++++++++++++--- .../roles/nginx/files/install-pmm-client.sh | 62 +++++++++++--- .../install-pmm-client/one-step-ui-install.md | 64 ++++++++------ managed/services/grafana/client.go | 85 +++++++++++++------ managed/services/management/deps.go | 2 +- managed/services/management/install_token.go | 30 +++---- .../services/management/install_token_test.go | 40 ++++++++- .../management/mock_grafana_client_test.go | 6 +- ui/apps/pmm/src/api/installToken.ts | 6 +- .../install-client/InstallClientPage.tsx | 4 +- .../InstallClientPage.utils.test.ts | 28 +++++- .../install-client/InstallClientPage.utils.ts | 9 +- 12 files changed, 299 insertions(+), 104 deletions(-) diff --git a/api-tests/management/nodes_test.go b/api-tests/management/nodes_test.go index 80f387bde5d..7bc73a3e5ad 100644 --- a/api-tests/management/nodes_test.go +++ b/api-tests/management/nodes_test.go @@ -449,15 +449,60 @@ func TestNodeRegister(t *testing.T) { func TestCreateNodeInstallToken(t *testing.T) { t.Parallel() - params := mservice.CreateNodeInstallTokenParams{ - Context: pmmapitests.Context, - Body: mservice.CreateNodeInstallTokenBody{ - Technology: "mysql", - }, - } - ok, err := client.Default.ManagementService.CreateNodeInstallToken(¶ms) - require.NoError(t, err) - require.NotNil(t, ok) - require.NotNil(t, ok.Payload) - assert.NotEmpty(t, ok.Payload.Token) + t.Run("ok mysql with default ttl", func(t *testing.T) { + t.Parallel() + params := mservice.CreateNodeInstallTokenParams{ + Context: pmmapitests.Context, + Body: mservice.CreateNodeInstallTokenBody{ + Technology: "mysql", + }, + } + ok, err := client.Default.ManagementService.CreateNodeInstallToken(¶ms) + require.NoError(t, err) + require.NotNil(t, ok) + require.NotNil(t, ok.Payload) + assert.NotEmpty(t, ok.Payload.Token) + assert.NotZero(t, ok.Payload.ServiceAccountID) + assert.NotNil(t, ok.Payload.ExpiresAt) + }) + + t.Run("invalid technology returns 400", func(t *testing.T) { + t.Parallel() + params := mservice.CreateNodeInstallTokenParams{ + Context: pmmapitests.Context, + Body: mservice.CreateNodeInstallTokenBody{ + Technology: "oracle", + }, + } + ok, err := client.Default.ManagementService.CreateNodeInstallToken(¶ms) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, `unsupported technology "oracle"`) + require.Nil(t, ok) + }) + + t.Run("empty technology returns 400", func(t *testing.T) { + t.Parallel() + params := mservice.CreateNodeInstallTokenParams{ + Context: pmmapitests.Context, + Body: mservice.CreateNodeInstallTokenBody{}, + } + ok, err := client.Default.ManagementService.CreateNodeInstallToken(¶ms) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, `unsupported technology`) + require.Nil(t, ok) + }) + + t.Run("ttl above the cap is silently clamped, request still succeeds", func(t *testing.T) { + t.Parallel() + params := mservice.CreateNodeInstallTokenParams{ + Context: pmmapitests.Context, + Body: mservice.CreateNodeInstallTokenBody{ + Technology: "postgresql", + TTLSeconds: 24 * 60 * 60, // 24h — way above the 15-min hard cap. + }, + } + ok, err := client.Default.ManagementService.CreateNodeInstallToken(¶ms) + require.NoError(t, err) + require.NotNil(t, ok) + require.NotNil(t, ok.Payload) + assert.NotEmpty(t, ok.Payload.Token) + }) } diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh index 72c417db48f..3127362628c 100644 --- a/build/ansible/roles/nginx/files/install-pmm-client.sh +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -300,12 +300,10 @@ systemd_is_running() { # Cheap TCP probe via bash builtins; no curl/nc dependency. We only need to know # the local API socket is bound — pmm-admin will do the actual HTTP handshake. +# Anything else listening on that port (very unlikely on 7777) would falsely report +# success; that case fails clearly at the next pmm-admin step. pmm_agent_listening() { - (exec 3<>"/dev/tcp/${PMM_AGENT_LISTEN_HOST}/${PMM_AGENT_LISTEN_PORT}") >/dev/null 2>&1 && { - exec 3>&- 3<&- - return 0 - } - return 1 + (exec 3<>"/dev/tcp/${PMM_AGENT_LISTEN_HOST}/${PMM_AGENT_LISTEN_PORT}") >/dev/null 2>&1 } wait_for_pmm_agent() { @@ -374,8 +372,21 @@ start_pmm_agent_nohup() { error "pmm-agent binary not found in PATH; cannot start it manually." fi mkdir -p "$(dirname "${PMM_AGENT_LOG_FILE}")" 2>/dev/null || true - log "Starting pmm-agent in the background (no usable systemd); logging to ${PMM_AGENT_LOG_FILE}" - nohup pmm-agent --config-file="${PMM_AGENT_CONFIG_FILE}" \ + + # Drop privileges to the pmm-agent system user when it exists (created by the + # package's postinst). The systemd unit runs as that user too, so this keeps + # the nohup fallback from being a privilege regression vs. systemd. If the + # user is missing (very minimal images, broken postinst), fall back to root — + # the agent still works, just with a wider blast radius if it's ever exploited. + local runner=() + if id -u pmm-agent >/dev/null 2>&1 && command -v runuser >/dev/null 2>&1; then + runner=(runuser -u pmm-agent --) + log "Starting pmm-agent as user pmm-agent (no usable systemd); logging to ${PMM_AGENT_LOG_FILE}" + else + log "Starting pmm-agent as root (no pmm-agent user or no runuser binary); logging to ${PMM_AGENT_LOG_FILE}" + fi + + nohup "${runner[@]}" pmm-agent --config-file="${PMM_AGENT_CONFIG_FILE}" \ >>"${PMM_AGENT_LOG_FILE}" 2>&1 & disown 2>/dev/null || true } @@ -422,13 +433,12 @@ ensure_pmm_agent_running() { # When stdin is not a terminal (e.g. curl ... | bash), prompts cannot be used for DB # credentials. Fail before pmm-admin config so we do not register the node and then fail on add. +# Caller must have already invoked apply_generic_inputs. require_db_creds_before_config_if_noninteractive() { if [[ -t 0 ]]; then return 0 fi - apply_generic_inputs - local hint='This install is non-interactive (stdin is not a terminal, e.g. curl ... | bash), so database credentials cannot be prompted. Set them before the agent registers with PMM Server: use --db-user and --db-password, or DB_USER and DB_PASSWORD (include them in sudo env if you use sudo env; use sudo -E to preserve exports).' case "${TECH}" in @@ -589,8 +599,11 @@ add_valkey() { } add_service() { - apply_generic_inputs - + # IMPORTANT: keep this list in sync with: + # - installTokenTechnologies in managed/services/management/install_token.go + # - the Technology union in ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts + # If you add a tech here, also add a matching add_ function above and the require_* + # branch in require_db_creds_before_config_if_noninteractive. case "${TECH}" in mysql) add_mysql @@ -610,12 +623,39 @@ add_service() { esac } +# Print a tailored recovery hint when `pmm-admin add` fails after `pmm-admin config` +# has already registered the node. The most common cause we see in the field is +# wrong DB credentials; the second most common is leftover state from a previous +# attempt. Either way the user wants `--force` on the next run + corrected creds. +report_add_service_failure() { + local exit_code="$1" + echo >&2 + log "ERROR: 'pmm-admin add ${TECH}' failed (exit ${exit_code}) after the node was already registered with PMM Server." + log " The node is now visible on PMM Server but no service is attached to it." + log " Most common causes:" + log " * Wrong DB credentials → fix DB_USER / DB_PASSWORD (or --db-user / --db-password) and re-run." + log " * Service already attached from a prior attempt → re-run with --force (or PMM_CONFIG_FORCE=1)" + log " which removes the previous node registration and its services on the server before re-registering." + log " For MongoDB also check --db-auth-db / DB_AUTH_DB; for PostgreSQL check --db-name / DB_NAME." + exit "${exit_code}" +} + main() { require_root install_pmm_client + apply_generic_inputs ensure_pmm_agent_running configure_pmm_agent + # Disable -e for the add step so we can intercept its non-zero exit, print a + # helpful recovery message, and propagate the original status. `set -E` would + # work too but only on bash >= 4 and changes broader trap semantics. + set +e add_service + local rc=$? + set -e + if [[ "${rc}" -ne 0 ]]; then + report_add_service_failure "${rc}" + fi log "PMM client setup completed successfully." } diff --git a/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md b/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md index 1af8c5dc2f3..0f00a1627e5 100644 --- a/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md +++ b/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md @@ -1,54 +1,62 @@ # One-step PMM Client install from UI -Use the **Install PMM Client** wizard to generate a single command that installs `pmm-client`, registers the node, and adds one monitored service. +Use the **Install PMM Client** wizard to generate a single command that installs `pmm-client`, registers the node with PMM Server, and adds one monitored service. ## Before you start -- PMM Server must be reachable from the target node on `443`. -- The node user running the command needs `sudo` access. -- You need a PMM token that works with `pmm-admin config --server-url`, for example: - - `https://service_token:GLSA_...@:443` +- PMM Server must be reachable from the target node (default port `443`; whatever you set in **PMM host** is used in `PMM_SERVER_URL`). +- The node user running the command needs `sudo` access (or run it as `root`, e.g. inside a container). +- A short-lived service token is minted from the UI on demand — you do not need to provision one beforehand. Tokens use Grafana **Editor** organization role and **expire 15 minutes after generation**; treat the URL like a password. ## Generate the command -1. In PMM UI, open **Inventory** -> **Install PMM Client**. +1. In PMM UI, open **Inventory → Install PMM Client**. 2. Choose technology: `MySQL`, `PostgreSQL`, `MongoDB`, or `Valkey`. -3. Select credentials mode: - - **Prompt on node (recommended)**: password is typed interactively on the node. - - **Include env variables**: password is passed through environment variables. - - **Pass as script flags**: password is passed as script arguments. -4. Paste your service token and adjust optional fields (node name/address, DB host/port, service name). -5. Copy the generated command and run it on the target node. +3. Click **Generate short-lived token**. The countdown chip shows the remaining lifetime. +4. Select the credentials mode: + - **Include env variables (recommended for `curl | bash`)**: credentials are passed in the environment of the spawned shell. This is the default and works with the one-liner. + - **Pass as script flags**: credentials are passed as `--db-*` script arguments instead of env vars. Same security profile as env mode, just a different surface. + - **Prompt on node (TTY only)**: the script asks for credentials interactively. This **only works** if you save the script and run it from a real shell (`sudo bash ./install-pmm-client.sh ...`); piping from `curl` consumes stdin and the prompt cannot read your keyboard. +5. Fill in the optional fields you need (node name/address, DB host/port, service name, MongoDB auth DB, PostgreSQL database). +6. Copy the generated command and run it on the target node before the token expires. -Example (env mode): +Example (env mode, matches what the wizard renders): ```bash -curl -fsSL "https:///pmm-static/install-pmm-client.sh" | sudo env \ - PMM_SERVER_URL='https://service_token:@:443' \ - PMM_SERVER_INSECURE_TLS=1 \ - TECH=mysql \ +curl -fsSLk 'https:///pmm-static/install-pmm-client.sh' | sudo -E env \ + PMM_SERVER_URL='https://service_token:@' \ + TECH='mysql' \ DB_USER='pmm' \ DB_PASSWORD='secret' \ - bash + bash -s -- \ + --pmm-server-insecure-tls ``` +Notes on the rendered command: + +- `curl -fsSLk` (with `-k`) is emitted only when **Use insecure TLS** is on; with a properly signed PMM Server certificate the wizard drops the `-k`. +- TLS-skip on the PMM Server side is controlled by the `--pmm-server-insecure-tls` script flag (passed after `bash -s --`). The script also accepts `PMM_SERVER_INSECURE_TLS=1` as an env var if you build the command by hand. +- `sudo -E env VAR=... bash -s --` is the standard shape; `-E` preserves your shell's exports while the explicit `VAR=...` list gets handed to `bash`'s environment (and therefore to the script). + ## What the script does The script available at `/pmm-static/install-pmm-client.sh` performs: -1. Install `pmm-client` using the OS package manager (RHEL-compatible or Debian-compatible hosts). -2. Run `pmm-admin config` against your PMM server. -3. Run `pmm-admin register`. -4. Run `pmm-admin add ` using your selected options. +1. Installs `pmm-client` using the OS package manager (RHEL-compatible or Debian-compatible hosts). +2. Ensures `pmm-agent` is running (starts it via `systemd` when available, otherwise `nohup` in the background). +3. Runs `pmm-admin config` against your PMM server to register the node and persist the agent identity. +4. Runs `pmm-admin add ` using your selected options. ## Security notes -- Prefer **Prompt on node** for production to avoid exposing DB passwords in shell history and process lists. -- If you use env or flags modes, clean shell history and avoid sharing terminal logs. -- The generated command is created in the browser; secrets are not written into a static script on PMM Server. +- Generated tokens use Grafana **Editor** organization role (not Grafana Admin) and live for **15 minutes** — generate, run, done. There is no way to extend the lifetime from the UI. +- Env mode and flags mode put credentials into the shell command line and the spawned process environment. On a shared node, that may be visible in `ps`/`/proc` to other users for a moment. Prompt mode avoids this but, as noted above, can only be used from a real terminal — not through `curl | bash`. +- Avoid copy-pasting the command into chat/issue trackers; the embedded service token is a credential. ## Troubleshooting -- If TLS is self-signed, enable `PMM_SERVER_INSECURE_TLS`. -- If package install fails, verify outbound access to Percona repositories. -- If registration fails for existing nodes, enable force re-registration (`PMM_REGISTER_FORCE=1` / `--register-force`). +- **TLS handshake errors against PMM Server** — turn on **Use insecure TLS** in the wizard (sets the `--pmm-server-insecure-tls` script flag). The wizard also adds `-k` to `curl` so the script download itself succeeds. +- **Package install fails** — verify outbound access to the Percona repositories (`repo.percona.com`). +- **`pmm-admin add` fails (auth, name conflict, etc.)** — the node was already registered by `pmm-admin config`. Re-run with **Force re-register node** enabled (this passes `--force` to `pmm-admin config`, which removes the previous node and its services on the server before re-registering). You may also have to fix the database credentials before retrying. +- **`pmm-agent is not running`** — happens in containers without `systemd`. The script auto-starts it via `nohup` and writes logs to `/var/log/pmm-agent.log`; check there. +- **`hostname: command not found`** — only on extremely minimal images; the script falls back to `$HOSTNAME`/`uname -n`/`/etc/hostname` and finally `node`. diff --git a/managed/services/grafana/client.go b/managed/services/grafana/client.go index 63ae3d58ebd..78336a2eabe 100644 --- a/managed/services/grafana/client.go +++ b/managed/services/grafana/client.go @@ -29,6 +29,7 @@ import ( "time" gapi "github.com/grafana/grafana-api-golang-client" + "github.com/google/uuid" "github.com/pkg/errors" prom "github.com/prometheus/client_golang/prometheus" "github.com/sirupsen/logrus" @@ -46,9 +47,13 @@ import ( var ErrFailedToGetToken = errors.New("failed to get the user token") const ( - pmmServiceTokenName = "pmm-agent-st" //nolint:gosec - pmmServiceAccountName = "pmm-agent-sa" //nolint:gosec + pmmServiceTokenName = "pmm-agent-st" //nolint:gosec + pmmServiceAccountName = "pmm-agent-sa" //nolint:gosec pmmInstallServiceTokenPrefix = "pmm-install-st" //nolint:gosec + // pmmInstallServiceAccountName is the *prefix* for shared install SAs. + // One SA per technology is created lazily on first use ("-mysql", "-postgresql", ...); + // every CreateNodeInstallToken call mints a new short-lived token on the existing SA + // instead of creating a fresh SA each time (which would leak Grafana rows over time). pmmInstallServiceAccountName = "pmm-install-sa" //nolint:gosec defaultDialTimeout = 3 * time.Second defaultKeepAliveTimeout = 30 * time.Second @@ -429,8 +434,18 @@ func (c *Client) CreateServiceAccount(ctx context.Context, nodeName string, rere return serviceAccountID, serviceToken, nil } -// CreateNodeInstallToken creates a Grafana service account and a short-lived token (secondsToLive) for PMM Client install scripts. -func (c *Client) CreateNodeInstallToken(ctx context.Context, uniqueSuffix string, ttlSeconds int64) (int64, string, time.Time, error) { +// CreateNodeInstallToken mints a short-lived Grafana token for a PMM Client install script. +// +// Lifecycle: +// - Service accounts are shared per technology ("pmm-install-sa-mysql" etc.) and created +// lazily on first use. This avoids the unbounded growth of one-SA-per-token. +// - Each call mints a brand new token on the per-tech SA with a UUID-suffixed name so +// concurrent or repeated calls cannot collide on Grafana's unique-name constraint. +// - The token role is `editor` rather than `admin`: it only needs to register a node and +// add a service via pmm-admin, neither of which requires admin scope. +// - The returned expiry is computed locally from `ttlSeconds`; Grafana enforces the same +// TTL server-side, so the two should agree to within clock skew. +func (c *Client) CreateNodeInstallToken(ctx context.Context, technology string, ttlSeconds int64) (int64, string, time.Time, error) { authHeaders, err := auth.GetHeadersFromContext(ctx) if err != nil { return 0, "", time.Time{}, err @@ -438,56 +453,74 @@ func (c *Client) CreateNodeInstallToken(ctx context.Context, uniqueSuffix string if ttlSeconds <= 0 { return 0, "", time.Time{}, errors.New("ttlSeconds must be positive") } + if technology == "" { + return 0, "", time.Time{}, errors.New("technology must not be empty") + } - saID, err := c.createInstallServiceAccount(ctx, uniqueSuffix, authHeaders) + saName := fmt.Sprintf("%s-%s", pmmInstallServiceAccountName, technology) + + saID, err := c.findServiceAccountIDByExactName(ctx, saName, authHeaders) if err != nil { - return 0, "", time.Time{}, err + // Not present yet — create it. We pass force=false on purpose: if a SA + // with the same name somehow already exists (e.g. a racing concurrent call + // that beat the search→miss above), we want the create to fail loudly so + // the next call's search hits it, rather than silently nuking existing tokens. + saID, err = c.createServiceAccountNamed(ctx, saName, editor, false, authHeaders) + if err != nil { + return 0, "", time.Time{}, err + } } - _, tok, err := c.createInstallServiceToken(ctx, saID, uniqueSuffix, ttlSeconds, authHeaders) + tokenName := fmt.Sprintf("%s-%s-%s", pmmInstallServiceTokenPrefix, technology, uuid.NewString()) + key, err := c.createInstallServiceToken(ctx, saID, tokenName, ttlSeconds, authHeaders) if err != nil { return 0, "", time.Time{}, err } - return int64(saID), tok, time.Now().Add(time.Duration(ttlSeconds) * time.Second), nil + return int64(saID), key, time.Now().Add(time.Duration(ttlSeconds) * time.Second), nil } -func (c *Client) createInstallServiceAccount(ctx context.Context, uniqueSuffix string, authHeaders http.Header) (int, error) { - serviceAccountName := fmt.Sprintf("%s-%s", pmmInstallServiceAccountName, uniqueSuffix) - return c.createServiceAccountNamed(ctx, serviceAccountName, admin, false, authHeaders) +// findServiceAccountIDByExactName looks up a Grafana service account by exact name. +// Returns an error wrapping "not found" so callers can branch on errors.Is or just retry-create. +func (c *Client) findServiceAccountIDByExactName(ctx context.Context, name string, authHeaders http.Header) (int, error) { + var res serviceAccountSearch + if err := c.do(ctx, http.MethodGet, "/api/serviceaccounts/search", fmt.Sprintf("query=%s", name), authHeaders, nil, &res); err != nil { + return 0, err + } + for _, sa := range res.ServiceAccounts { + if sa.Name == name { + return sa.ID, nil + } + } + return 0, errors.Errorf("service account %q not found", name) } -func (c *Client) createInstallServiceToken( - ctx context.Context, - serviceAccountID int, - uniqueSuffix string, - ttlSeconds int64, - authHeaders http.Header, -) (int, string, error) { - tokenName := fmt.Sprintf("%s-%s", pmmInstallServiceTokenPrefix, uniqueSuffix) +// createInstallServiceToken POSTs a Grafana service-account token with the given name and TTL, +// and returns the freshly minted secret. The secret cannot be re-fetched from Grafana later, +// so the caller must persist it from the response. +func (c *Client) createInstallServiceToken(ctx context.Context, serviceAccountID int, tokenName string, ttlSeconds int64, authHeaders http.Header) (string, error) { b, err := json.Marshal(struct { Name string `json:"name"` Role string `json:"role"` SecondsToLive int64 `json:"secondsToLive"` }{ Name: tokenName, - Role: admin.String(), + Role: editor.String(), SecondsToLive: ttlSeconds, }) if err != nil { - return 0, "", errors.WithStack(err) + return "", errors.WithStack(err) } var m map[string]interface{} if err = c.do(ctx, "POST", fmt.Sprintf("/api/serviceaccounts/%d/tokens", serviceAccountID), "", authHeaders, b, &m); err != nil { - return 0, "", err + return "", err } - serviceTokenKey, ok := m["key"].(string) + key, ok := m["key"].(string) if !ok { - return 0, "", errors.Errorf("grafana token response missing key: %#v", m) + return "", errors.Errorf("grafana token response missing key: %#v", m) } - - return 0, serviceTokenKey, nil + return key, nil } // DeleteServiceAccount deletes service account by current service token. diff --git a/managed/services/management/deps.go b/managed/services/management/deps.go index c5bc678bdda..d416e9a5d27 100644 --- a/managed/services/management/deps.go +++ b/managed/services/management/deps.go @@ -70,7 +70,7 @@ type checksService interface { type grafanaClient interface { CreateAnnotation(ctx context.Context, tags []string, time time.Time, text string, user string) (string, error) CreateServiceAccount(ctx context.Context, noneName string, reregister bool) (int, string, error) - CreateNodeInstallToken(ctx context.Context, uniqueSuffix string, ttlSeconds int64) (int64, string, time.Time, error) + CreateNodeInstallToken(ctx context.Context, technology string, ttlSeconds int64) (int64, string, time.Time, error) DeleteServiceAccount(ctx context.Context, noneName string, force bool) (string, error) } diff --git a/managed/services/management/install_token.go b/managed/services/management/install_token.go index 393a15b95bd..37ebc2449c3 100644 --- a/managed/services/management/install_token.go +++ b/managed/services/management/install_token.go @@ -17,9 +17,7 @@ package management import ( "context" - "fmt" "strings" - "time" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -31,19 +29,23 @@ import ( // Install-token lifetime is intentionally short: the token is only used for the // initial pmm-admin config handshake, after which pmm-agent stores its own // per-agent identity and no longer needs it. A 15-minute window covers normal -// install runs while limiting damage if the URL leaks (the token is admin-role -// on Grafana, so treat it like a password). +// install runs while limiting damage if the URL leaks. The token is editor-role +// on Grafana — narrower than admin but still privileged, so treat it like a password. const ( defaultInstallTokenTTLSeconds = int64(15 * 60) // 15 minutes maxInstallTokenTTLSeconds = int64(15 * 60) // 15 minutes; hard cap, no caller can exceed minInstallTokenTTLSeconds = int64(60) // 1 minute floor to leave room for slow installs ) +// IMPORTANT: keep this list in sync with the `Technology` union in +// ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts — adding a tech +// to one without the other yields either a UI-unreachable code path (server-only) +// or an InvalidArgument at runtime (UI-only). var installTokenTechnologies = map[string]struct{}{ - "mysql": {}, - "postgresql": {}, - "mongodb": {}, - "valkey": {}, + "mysql": {}, + "postgresql": {}, + "mongodb": {}, + "valkey": {}, } // CreateNodeInstallToken mints a short-lived Grafana token for PMM Client install; it does not create inventory rows. @@ -57,18 +59,16 @@ func (s *ManagementService) CreateNodeInstallToken( } ttl := int64(req.GetTtlSeconds()) - if ttl == 0 { + switch { + case ttl == 0: ttl = defaultInstallTokenTTLSeconds - } - if ttl < minInstallTokenTTLSeconds { + case ttl < minInstallTokenTTLSeconds: ttl = minInstallTokenTTLSeconds - } - if ttl > maxInstallTokenTTLSeconds { + case ttl > maxInstallTokenTTLSeconds: ttl = maxInstallTokenTTLSeconds } - unique := fmt.Sprintf("%s-%d", tech, time.Now().UnixNano()) - saID, tok, exp, err := s.grafanaClient.CreateNodeInstallToken(ctx, unique, ttl) + saID, tok, exp, err := s.grafanaClient.CreateNodeInstallToken(ctx, tech, ttl) if err != nil { return nil, err } diff --git a/managed/services/management/install_token_test.go b/managed/services/management/install_token_test.go index 30895ae84cf..320a7af3ebc 100644 --- a/managed/services/management/install_token_test.go +++ b/managed/services/management/install_token_test.go @@ -38,7 +38,9 @@ func TestManagementService_CreateNodeInstallToken(t *testing.T) { t.Run("ok", func(t *testing.T) { t.Parallel() gc := &mockGrafanaClient{} - gc.On("CreateNodeInstallToken", mock.Anything, mock.MatchedBy(func(s string) bool { return s != "" }), defaultInstallTokenTTLSeconds). + // Asserts the grafana client receives the lowercased, trimmed technology — not a + // computed unique suffix — so the shared-SA-per-tech contract stays intact. + gc.On("CreateNodeInstallToken", mock.Anything, "mysql", defaultInstallTokenTTLSeconds). Return(int64(42), "tok", exp, nil).Once() s := &ManagementService{grafanaClient: gc} @@ -52,6 +54,18 @@ func TestManagementService_CreateNodeInstallToken(t *testing.T) { require.NotNil(t, res.ExpiresAt) }) + t.Run("normalises technology casing and whitespace", func(t *testing.T) { + t.Parallel() + gc := &mockGrafanaClient{} + gc.On("CreateNodeInstallToken", mock.Anything, "mongodb", defaultInstallTokenTTLSeconds). + Return(int64(7), "k", exp, nil).Once() + s := &ManagementService{grafanaClient: gc} + _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{ + Technology: " MongoDB ", + }) + require.NoError(t, err) + }) + t.Run("invalid technology", func(t *testing.T) { t.Parallel() s := &ManagementService{grafanaClient: &mockGrafanaClient{}} @@ -60,10 +74,18 @@ func TestManagementService_CreateNodeInstallToken(t *testing.T) { assert.Equal(t, codes.InvalidArgument, status.Code(err)) }) + t.Run("empty technology", func(t *testing.T) { + t.Parallel() + s := &ManagementService{grafanaClient: &mockGrafanaClient{}} + _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{}) + require.Error(t, err) + assert.Equal(t, codes.InvalidArgument, status.Code(err)) + }) + t.Run("ttl clamp max", func(t *testing.T) { t.Parallel() gc := &mockGrafanaClient{} - gc.On("CreateNodeInstallToken", mock.Anything, mock.Anything, int64(maxInstallTokenTTLSeconds)). + gc.On("CreateNodeInstallToken", mock.Anything, "postgresql", maxInstallTokenTTLSeconds). Return(int64(1), "t", exp, nil).Once() s := &ManagementService{grafanaClient: gc} _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{ @@ -76,7 +98,7 @@ func TestManagementService_CreateNodeInstallToken(t *testing.T) { t.Run("ttl clamp min", func(t *testing.T) { t.Parallel() gc := &mockGrafanaClient{} - gc.On("CreateNodeInstallToken", mock.Anything, mock.Anything, int64(minInstallTokenTTLSeconds)). + gc.On("CreateNodeInstallToken", mock.Anything, "mongodb", minInstallTokenTTLSeconds). Return(int64(1), "t", exp, nil).Once() s := &ManagementService{grafanaClient: gc} _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{ @@ -85,4 +107,16 @@ func TestManagementService_CreateNodeInstallToken(t *testing.T) { }) require.NoError(t, err) }) + + t.Run("propagates grafana client error", func(t *testing.T) { + t.Parallel() + gc := &mockGrafanaClient{} + grafanaErr := status.Error(codes.Unavailable, "grafana down") + gc.On("CreateNodeInstallToken", mock.Anything, "valkey", defaultInstallTokenTTLSeconds). + Return(int64(0), "", time.Time{}, grafanaErr).Once() + s := &ManagementService{grafanaClient: gc} + _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{Technology: "valkey"}) + require.Error(t, err) + assert.Equal(t, codes.Unavailable, status.Code(err)) + }) } diff --git a/managed/services/management/mock_grafana_client_test.go b/managed/services/management/mock_grafana_client_test.go index feabcf744da..475d9c992cd 100644 --- a/managed/services/management/mock_grafana_client_test.go +++ b/managed/services/management/mock_grafana_client_test.go @@ -78,15 +78,15 @@ func (_m *mockGrafanaClient) CreateServiceAccount(ctx context.Context, noneName } // CreateNodeInstallToken provides a mock function for install-token flow. -func (_m *mockGrafanaClient) CreateNodeInstallToken(ctx context.Context, uniqueSuffix string, ttlSeconds int64) (int64, string, time.Time, error) { - ret := _m.Called(ctx, uniqueSuffix, ttlSeconds) +func (_m *mockGrafanaClient) CreateNodeInstallToken(ctx context.Context, technology string, ttlSeconds int64) (int64, string, time.Time, error) { + ret := _m.Called(ctx, technology, ttlSeconds) var r0 int64 var r1 string var r2 time.Time var r3 error if rf, ok := ret.Get(0).(func(context.Context, string, int64) (int64, string, time.Time, error)); ok { - return rf(ctx, uniqueSuffix, ttlSeconds) + return rf(ctx, technology, ttlSeconds) } if ret.Get(0) != nil { r0 = ret.Get(0).(int64) diff --git a/ui/apps/pmm/src/api/installToken.ts b/ui/apps/pmm/src/api/installToken.ts index 2d8b98e86a0..c4265613f95 100644 --- a/ui/apps/pmm/src/api/installToken.ts +++ b/ui/apps/pmm/src/api/installToken.ts @@ -4,10 +4,12 @@ import { MANAGEMENT_CREATE_NODE_INSTALL_TOKEN } from './managementEndpoints'; export interface CreateNodeInstallTokenResponse { token: string; expiresAt?: string; - serviceAccountId?: string; + // The server also returns serviceAccountId (int64-as-string in JSON), but the + // UI does not consume it today. Re-add the field if/when we expose a revoke + // action — see managed/services/grafana/client.go::CreateNodeInstallToken. } -/** Mints a short-lived Grafana token for PMM Client install (admin session). */ +/** Mints a short-lived Grafana token for PMM Client install (caller must be authenticated; token is Grafana Editor-role). */ export async function createNodeInstallToken( technology: string, ttlSeconds = 0 diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index a513a630423..892dff6eab6 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -163,8 +163,8 @@ export const InstallClientPage = () => { run it from a real shell. - Generated tokens are admin-role and valid for 15 minutes — treat the - URL like a password. + Generated tokens are Grafana Editor–role and valid for 15 minutes{' '} + — treat the URL like a password. diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts index 2bdb794b40f..564a4d7d3aa 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.test.ts @@ -68,12 +68,38 @@ describe('buildInstallCommand', () => { expect(cmd).toContain("DB_SERVICE_NAME='node-mysql'"); }); - test('omits insecure TLS flag when disabled', () => { + test('omits insecure TLS flag and drops curl -k when disabled', () => { const cmd = buildInstallCommand({ ...baseOptions, insecureTLS: false }); expect(cmd).not.toContain('--pmm-server-insecure-tls'); + expect(cmd).toContain('curl -fsSL '); + expect(cmd).not.toContain('curl -fsSLk'); expect(cmd).toContain('bash -s --'); }); + test('uses curl -fsSLk when insecure TLS is on', () => { + const cmd = buildInstallCommand({ ...baseOptions, insecureTLS: true }); + expect(cmd).toContain('curl -fsSLk '); + expect(cmd).toContain('--pmm-server-insecure-tls'); + }); + + test('flags mode also respects the insecure TLS toggle for curl', () => { + const secure = buildInstallCommand({ + ...optionsWithDb, + credentialsMode: 'flags', + insecureTLS: false, + }); + const insecure = buildInstallCommand({ + ...optionsWithDb, + credentialsMode: 'flags', + insecureTLS: true, + }); + expect(secure).toContain('curl -fsSL '); + expect(secure).not.toContain('curl -fsSLk'); + expect(secure).not.toContain('--pmm-server-insecure-tls'); + expect(insecure).toContain('curl -fsSLk '); + expect(insecure).toContain('--pmm-server-insecure-tls'); + }); + test('includes DB credentials in env mode', () => { const cmd = buildInstallCommand({ ...optionsWithDb, diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts index f23544efcc7..8c340c04c2f 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts @@ -1,3 +1,6 @@ +// IMPORTANT: keep this list in sync with `installTokenTechnologies` in +// managed/services/management/install_token.go — adding a tech here without +// adding it there gets you a runtime InvalidArgument from the server. export type Technology = 'mysql' | 'postgresql' | 'mongodb' | 'valkey'; export type CredentialsMode = 'prompt' | 'env' | 'flags'; @@ -50,7 +53,11 @@ export const shellEscape = (value: string): string => `'${value.replace(/'/g, `'\\''`)}'`; export const buildInstallCommand = (opts: InstallCommandOptions): string => { - const curl = `curl -fsSLk ${shellEscape(opts.installerUrl)}`; + // -k is for the PMM Server certificate; emit it only when the user opted into + // insecure TLS. With a properly signed cert we want curl to verify normally + // (otherwise we'd be silently downgrading the security of every install). + const curlFlags = opts.insecureTLS ? '-fsSLk' : '-fsSL'; + const curl = `curl ${curlFlags} ${shellEscape(opts.installerUrl)}`; const envVars: string[] = [ `PMM_SERVER_URL=${shellEscape(opts.serverURL)}`, From 242bb80add87e384dc85dce7bda97594748ae7cb Mon Sep 17 00:00:00 2001 From: theTibi Date: Wed, 29 Apr 2026 14:47:48 +0200 Subject: [PATCH 11/36] Update PMM Client Installation Documentation and Token Management - Clarified that the service token for PMM Client installation is generated with Grafana Admin role, enhancing security awareness. - Updated documentation to reflect the correct role and expiration details for generated tokens. - Modified the `CreateNodeInstallToken` function to ensure service accounts are created with Admin role, aligning with the updated security model. - Adjusted UI components to communicate the Admin role of generated tokens, reinforcing the importance of treating the token URL as a password. These changes improve the clarity and security of the PMM Client installation process. Signed-off-by: theTibi --- .../install-pmm-client/one-step-ui-install.md | 6 ++++-- managed/services/grafana/client.go | 21 ++++++++++++------- managed/services/management/install_token.go | 4 ++-- ui/apps/pmm/src/api/installToken.ts | 2 +- .../install-client/InstallClientPage.tsx | 2 +- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md b/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md index 0f00a1627e5..b935075f68b 100644 --- a/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md +++ b/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md @@ -6,7 +6,7 @@ Use the **Install PMM Client** wizard to generate a single command that installs - PMM Server must be reachable from the target node (default port `443`; whatever you set in **PMM host** is used in `PMM_SERVER_URL`). - The node user running the command needs `sudo` access (or run it as `root`, e.g. inside a container). -- A short-lived service token is minted from the UI on demand — you do not need to provision one beforehand. Tokens use Grafana **Editor** organization role and **expire 15 minutes after generation**; treat the URL like a password. +- A short-lived service token is minted from the UI on demand — you do not need to provision one beforehand. The Grafana **Install PMM Client** service account is **Admin** org role and **expires 15 minutes after generation**; treat the URL like a password. ## Generate the command @@ -49,12 +49,14 @@ The script available at `/pmm-static/install-pmm-client.sh` performs: ## Security notes -- Generated tokens use Grafana **Editor** organization role (not Grafana Admin) and live for **15 minutes** — generate, run, done. There is no way to extend the lifetime from the UI. +- Generated tokens are tied to Grafana service accounts minted as **Admin** org role and live for **15 minutes** — generate, run, done. There is no way to extend the lifetime from the UI. - Env mode and flags mode put credentials into the shell command line and the spawned process environment. On a shared node, that may be visible in `ps`/`/proc` to other users for a moment. Prompt mode avoids this but, as noted above, can only be used from a real terminal — not through `curl | bash`. - Avoid copy-pasting the command into chat/issue trackers; the embedded service token is a credential. ## Troubleshooting +- **curl / browser returns `404`** on URLs like `/graph/…` — PMM Web UI lives under **`/pmm-ui/`**. Use paths such as `/pmm-ui/graph/inventory/nodes`, not `/graph/inventory/nodes`. This matches what the browser loads (see address bar vs. truncated copy-pastes). + - **TLS handshake errors against PMM Server** — turn on **Use insecure TLS** in the wizard (sets the `--pmm-server-insecure-tls` script flag). The wizard also adds `-k` to `curl` so the script download itself succeeds. - **Package install fails** — verify outbound access to the Percona repositories (`repo.percona.com`). - **`pmm-admin add` fails (auth, name conflict, etc.)** — the node was already registered by `pmm-admin config`. Re-run with **Force re-register node** enabled (this passes `--force` to `pmm-admin config`, which removes the previous node and its services on the server before re-registering). You may also have to fix the database credentials before retrying. diff --git a/managed/services/grafana/client.go b/managed/services/grafana/client.go index 78336a2eabe..0cfa5aaabc5 100644 --- a/managed/services/grafana/client.go +++ b/managed/services/grafana/client.go @@ -441,10 +441,13 @@ func (c *Client) CreateServiceAccount(ctx context.Context, nodeName string, rere // lazily on first use. This avoids the unbounded growth of one-SA-per-token. // - Each call mints a brand new token on the per-tech SA with a UUID-suffixed name so // concurrent or repeated calls cannot collide on Grafana's unique-name constraint. -// - The token role is `editor` rather than `admin`: it only needs to register a node and -// add a service via pmm-admin, neither of which requires admin scope. -// - The returned expiry is computed locally from `ttlSeconds`; Grafana enforces the same -// TTL server-side, so the two should agree to within clock skew. +// - Service accounts use Grafana org role **Admin** (required for `pmm-admin config` / +// inventory APIs in real PMM setups). +// - Token creation uses only `name` + `secondsToLive` in the JSON body. Tokens inherit the +// service account permissions. (Sending extra fields such as `role` has been observed to +// make Grafana ignore `secondsToLive`, falling back to a long default expiry in the UI.) +// - The returned expiry is computed locally from `ttlSeconds`; aligned with Grafana's stored +// expiry when `secondsToLive` is honored. func (c *Client) CreateNodeInstallToken(ctx context.Context, technology string, ttlSeconds int64) (int64, string, time.Time, error) { authHeaders, err := auth.GetHeadersFromContext(ctx) if err != nil { @@ -465,7 +468,7 @@ func (c *Client) CreateNodeInstallToken(ctx context.Context, technology string, // with the same name somehow already exists (e.g. a racing concurrent call // that beat the search→miss above), we want the create to fail loudly so // the next call's search hits it, rather than silently nuking existing tokens. - saID, err = c.createServiceAccountNamed(ctx, saName, editor, false, authHeaders) + saID, err = c.createServiceAccountNamed(ctx, saName, admin, false, authHeaders) if err != nil { return 0, "", time.Time{}, err } @@ -498,14 +501,18 @@ func (c *Client) findServiceAccountIDByExactName(ctx context.Context, name strin // createInstallServiceToken POSTs a Grafana service-account token with the given name and TTL, // and returns the freshly minted secret. The secret cannot be re-fetched from Grafana later, // so the caller must persist it from the response. +// +// See https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#create-a-token +// — the supported body is `name` and `secondsToLive`. Token permissions follow the service +// account role (we create the install SAs as Admin). Do not add `role` here: some Grafana +// versions ignore `secondsToLive` when extra fields are present, and the UI may show a ~24h +// default expiry even though the server still applies a different TTL. func (c *Client) createInstallServiceToken(ctx context.Context, serviceAccountID int, tokenName string, ttlSeconds int64, authHeaders http.Header) (string, error) { b, err := json.Marshal(struct { Name string `json:"name"` - Role string `json:"role"` SecondsToLive int64 `json:"secondsToLive"` }{ Name: tokenName, - Role: editor.String(), SecondsToLive: ttlSeconds, }) if err != nil { diff --git a/managed/services/management/install_token.go b/managed/services/management/install_token.go index 37ebc2449c3..55d3ff14d7f 100644 --- a/managed/services/management/install_token.go +++ b/managed/services/management/install_token.go @@ -29,8 +29,8 @@ import ( // Install-token lifetime is intentionally short: the token is only used for the // initial pmm-admin config handshake, after which pmm-agent stores its own // per-agent identity and no longer needs it. A 15-minute window covers normal -// install runs while limiting damage if the URL leaks. The token is editor-role -// on Grafana — narrower than admin but still privileged, so treat it like a password. +// install runs while limiting damage if the URL leaks. The Grafana install service +// account uses org Admin; the token TTL is capped at 15 minutes — treat it like a password. const ( defaultInstallTokenTTLSeconds = int64(15 * 60) // 15 minutes maxInstallTokenTTLSeconds = int64(15 * 60) // 15 minutes; hard cap, no caller can exceed diff --git a/ui/apps/pmm/src/api/installToken.ts b/ui/apps/pmm/src/api/installToken.ts index c4265613f95..2b64915acd0 100644 --- a/ui/apps/pmm/src/api/installToken.ts +++ b/ui/apps/pmm/src/api/installToken.ts @@ -9,7 +9,7 @@ export interface CreateNodeInstallTokenResponse { // action — see managed/services/grafana/client.go::CreateNodeInstallToken. } -/** Mints a short-lived Grafana token for PMM Client install (caller must be authenticated; token is Grafana Editor-role). */ +/** Mints a short-lived Grafana token for PMM Client install (authenticated admin session). */ export async function createNodeInstallToken( technology: string, ttlSeconds = 0 diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index 892dff6eab6..579c0f7fee7 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -163,7 +163,7 @@ export const InstallClientPage = () => { run it from a real shell. - Generated tokens are Grafana Editor–role and valid for 15 minutes{' '} + Generated tokens are Grafana Admin–role on the minted install service account and valid for 15 minutes{' '} — treat the URL like a password. From 18a233e81f6017e5df4f34bf50e1ef12677c31dc Mon Sep 17 00:00:00 2001 From: theTibi Date: Mon, 4 May 2026 10:42:27 +0200 Subject: [PATCH 12/36] Enhance PMM Client Installation Script and UI for Prompt Mode - Updated the `install-pmm-client.sh` script to clarify the behavior of the prompt mode, ensuring it correctly handles database credentials by prompting users when the script is run interactively. - Modified the UI components to reflect the new two-step command for the prompt mode, improving user guidance on how to execute the installation script. - Enhanced documentation to explain the differences between installation modes, particularly emphasizing the security benefits of using prompt mode for sensitive credentials. - Updated tests to validate the new command generation logic for prompt mode, ensuring that no sensitive information is exposed in the command output. These changes improve the security and usability of the PMM client installation process. Signed-off-by: theTibi --- .../roles/nginx/files/install-pmm-client.sh | 19 ++- .../install-pmm-client/one-step-ui-install.md | 25 +++- .../install-client/InstallClientPage.tsx | 55 +++++--- .../InstallClientPage.utils.test.ts | 128 ++++++++++++++++-- .../install-client/InstallClientPage.utils.ts | 86 +++++++++--- 5 files changed, 256 insertions(+), 57 deletions(-) diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh index 3127362628c..d31b5183b7b 100644 --- a/build/ansible/roles/nginx/files/install-pmm-client.sh +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -36,6 +36,10 @@ Generic DB options (mapped per technology): Environment variables are also supported. Priority is: flags > env vars > interactive prompt. +When stdin is a terminal, database prompts are skipped if credentials are already +set from flags or environment (DB_USER / DB_PASSWORD and per-tech MYSQL_*, +POSTGRESQL_* / … after apply_generic_inputs). Use sudo -E bash … when running +as root so your exports reach the script. pmm-agent runtime knobs (env only): PMM_AGENT_CONFIG_FILE Path to pmm-agent.yaml (default: /usr/local/percona/pmm/config/pmm-agent.yaml) @@ -434,12 +438,25 @@ ensure_pmm_agent_running() { # When stdin is not a terminal (e.g. curl ... | bash), prompts cannot be used for DB # credentials. Fail before pmm-admin config so we do not register the node and then fail on add. # Caller must have already invoked apply_generic_inputs. +# +# Contract with the PMM UI's "Prompt on node" credentials mode: +# The UI deliberately renders a TWO-STEP command in that mode: +# 1) curl -fsSL[k] -o /tmp/install-pmm-client.sh '' +# 2) sudo -E bash /tmp/install-pmm-client.sh --pmm-server-url ... --tech ... [...] +# Step 2 reads the script from disk (not from a pipe), so stdin stays attached +# to the user's TTY through sudo, [[ -t 0 ]] is true, and prompt_if_empty / +# read -r -s in add_mysql / add_postgresql / add_mongodb / add_valkey can ask +# for DB user and password interactively — unless DB_USER / DB_PASSWORD (or +# per-tech MYSQL_* / …) are already set; sudo -E preserves those exports. +# This guard therefore never trips +# when the user followed the UI's prompt-mode command — it only protects the +# curl | bash pipeline from registering a half-configured node. require_db_creds_before_config_if_noninteractive() { if [[ -t 0 ]]; then return 0 fi - local hint='This install is non-interactive (stdin is not a terminal, e.g. curl ... | bash), so database credentials cannot be prompted. Set them before the agent registers with PMM Server: use --db-user and --db-password, or DB_USER and DB_PASSWORD (include them in sudo env if you use sudo env; use sudo -E to preserve exports).' + local hint='This install is non-interactive (stdin is not a terminal, e.g. curl ... | bash), so database credentials cannot be prompted. Either pass them up front (--db-user/--db-password or DB_USER/DB_PASSWORD; with sudo env, use sudo -E to preserve exports), or switch to the UI'\''s "Prompt on node" mode which renders a download-then-run command: curl -fsSLk -o /tmp/install-pmm-client.sh '\'''\''; sudo -E bash /tmp/install-pmm-client.sh --pmm-server-url ... --tech ...' case "${TECH}" in mysql) diff --git a/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md b/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md index b935075f68b..2f56eb4de41 100644 --- a/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md +++ b/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md @@ -16,7 +16,7 @@ Use the **Install PMM Client** wizard to generate a single command that installs 4. Select the credentials mode: - **Include env variables (recommended for `curl | bash`)**: credentials are passed in the environment of the spawned shell. This is the default and works with the one-liner. - **Pass as script flags**: credentials are passed as `--db-*` script arguments instead of env vars. Same security profile as env mode, just a different surface. - - **Prompt on node (TTY only)**: the script asks for credentials interactively. This **only works** if you save the script and run it from a real shell (`sudo bash ./install-pmm-client.sh ...`); piping from `curl` consumes stdin and the prompt cannot read your keyboard. + - **Prompt on node (downloads script first, asks for DB user/password)**: the wizard renders a **two-step** command — `curl … -o /tmp/install-pmm-client.sh ''` followed by `sudo -E bash /tmp/install-pmm-client.sh …`. Reading the script from disk (instead of piping it from `curl`) keeps stdin attached to your terminal, so the script can prompt you for the DB user and password. **`sudo -E`** preserves your environment into the root shell: if `DB_USER` / `DB_PASSWORD` (or per-tech `MYSQL_*`, `POSTGRESQL_*`, …) are already exported, the script uses them and **does not prompt**. Use this when you do not want credentials in the copied command line or process list from flags alone. 5. Fill in the optional fields you need (node name/address, DB host/port, service name, MongoDB auth DB, PostgreSQL database). 6. Copy the generated command and run it on the target node before the token expires. @@ -32,11 +32,24 @@ curl -fsSLk 'https:///pmm-static/install-pmm-client.sh' | sudo -E env --pmm-server-insecure-tls ``` +Example (prompt mode — credentials never appear in the rendered command): + +```bash +curl -fsSLk -o '/tmp/install-pmm-client.sh' 'https:///pmm-static/install-pmm-client.sh' +sudo -E bash '/tmp/install-pmm-client.sh' \ + --pmm-server-url 'https://service_token:@' \ + --tech 'mysql' \ + --pmm-server-insecure-tls +``` + +The second line runs `bash` against a file (not against a pipe), so `sudo` keeps stdin connected to your terminal. The script then asks twice — once for the DB user, once for the DB password (silent input) — before running `pmm-admin add`. Optional fields you fill in the wizard (host, port, service name, MongoDB auth DB, PostgreSQL database) are still passed as `--db-*` flags so you only have to type two things. + Notes on the rendered command: - `curl -fsSLk` (with `-k`) is emitted only when **Use insecure TLS** is on; with a properly signed PMM Server certificate the wizard drops the `-k`. -- TLS-skip on the PMM Server side is controlled by the `--pmm-server-insecure-tls` script flag (passed after `bash -s --`). The script also accepts `PMM_SERVER_INSECURE_TLS=1` as an env var if you build the command by hand. -- `sudo -E env VAR=... bash -s --` is the standard shape; `-E` preserves your shell's exports while the explicit `VAR=...` list gets handed to `bash`'s environment (and therefore to the script). +- TLS-skip on the PMM Server side is controlled by the `--pmm-server-insecure-tls` script flag (passed after `bash -s --`, or as an argument to `bash ` in prompt mode). The script also accepts `PMM_SERVER_INSECURE_TLS=1` as an env var if you build the command by hand. +- `sudo -E env VAR=... bash -s --` is the standard shape for env/flags modes; `-E` preserves your shell's exports while the explicit `VAR=...` list gets handed to `bash`'s environment (and therefore to the script). +- Prompt mode uses `sudo -E bash ...` instead of `sudo -E env … bash -s --`: there is no inline env block in the copied command, but `-E` still forwards your shell exports (e.g. `DB_USER` / `DB_PASSWORD`) so credentials can be supplied without prompts or appearing in the command string. Stdin stays on your TTY the same way as plain `sudo bash`. ## What the script does @@ -50,8 +63,8 @@ The script available at `/pmm-static/install-pmm-client.sh` performs: ## Security notes - Generated tokens are tied to Grafana service accounts minted as **Admin** org role and live for **15 minutes** — generate, run, done. There is no way to extend the lifetime from the UI. -- Env mode and flags mode put credentials into the shell command line and the spawned process environment. On a shared node, that may be visible in `ps`/`/proc` to other users for a moment. Prompt mode avoids this but, as noted above, can only be used from a real terminal — not through `curl | bash`. -- Avoid copy-pasting the command into chat/issue trackers; the embedded service token is a credential. +- Env mode and flags mode put credentials into the shell command line and the spawned process environment. On a shared node, that may be visible in `ps`/`/proc` to other users for a moment. **Prompt mode** avoids this entirely: the rendered command never contains the DB user or password, and the script reads them straight from your terminal once it is running on the node. +- Avoid copy-pasting the command into chat/issue trackers; the embedded service token is a credential. (In prompt mode the DB credentials are not in the command, but the PMM service token still is.) ## Troubleshooting @@ -62,3 +75,5 @@ The script available at `/pmm-static/install-pmm-client.sh` performs: - **`pmm-admin add` fails (auth, name conflict, etc.)** — the node was already registered by `pmm-admin config`. Re-run with **Force re-register node** enabled (this passes `--force` to `pmm-admin config`, which removes the previous node and its services on the server before re-registering). You may also have to fix the database credentials before retrying. - **`pmm-agent is not running`** — happens in containers without `systemd`. The script auto-starts it via `nohup` and writes logs to `/var/log/pmm-agent.log`; check there. - **`hostname: command not found`** — only on extremely minimal images; the script falls back to `$HOSTNAME`/`uname -n`/`/etc/hostname` and finally `node`. +- **Prompt mode does not actually prompt** — the script's noninteractive guard fires when stdin is not a TTY, e.g. when the prompt-mode command is invoked through `ssh host ''` (no allocated TTY) or through automation. Run it from an interactive shell on the node, or use **Include env variables** / **Pass as script flags** mode instead. +- **Cleanup after prompt mode** — the downloaded script lives at `/tmp/install-pmm-client.sh` after a successful install. It is harmless (no embedded secrets), but if you want it gone: `rm -f /tmp/install-pmm-client.sh`. diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index 579c0f7fee7..a5770bc82d7 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -158,9 +158,12 @@ export const InstallClientPage = () => { Choose installation options, then copy and run the generated command on your database - node. The usual curl … | bash form has no interactive terminal on stdin, - so use env variables or flags for database credentials unless you save the script and - run it from a real shell. + node. Include env variables and Pass as script flags use the usual{' '} + curl … | bash form. Prompt on node renders a two-step command + that downloads the script to /tmp/install-pmm-client.sh first, then runs + it with sudo -E bash so it can prompt you for the DB user and password on + the node (or skip prompts if you already exported DB_USER /{' '} + DB_PASSWORD-E keeps them visible to the script). Generated tokens are Grafana Admin–role on the minted install service account and valid for 15 minutes{' '} @@ -197,13 +200,15 @@ export const InstallClientPage = () => { Include env variables (recommended for curl | bash) Pass as script flags - Prompt on node (TTY only — save script and run in a terminal, not curl | bash) + Prompt on node (downloads script first, asks for DB user/password) - Piping from curl gives the script stdin, not your keyboard; prompts only work when - stdin is a terminal (e.g. download the script, then{' '} - sudo bash ./install-pmm-client.sh …). + In prompt mode the rendered command is a two-liner: curl -o downloads + the script to /tmp/install-pmm-client.sh, then{' '} + sudo -E bash runs it on a TTY so it can ask for the DB user and password, + or use credentials you already exported (DB_USER, DB_PASSWORD, or + per-tech MYSQL_* / …) without prompts. @@ -290,21 +295,27 @@ export const InstallClientPage = () => { /> - - setDbUser(e.target.value)} - /> - setDbPassword(e.target.value)} - /> - + {credentialsMode === 'prompt' ? ( + + DB user and password will be requested when the script runs on the node. + + ) : ( + + setDbUser(e.target.value)} + /> + setDbPassword(e.target.value)} + /> + + )} { }); describe('buildInstallCommand', () => { - test('omits DB env in prompt mode when DB fields are empty', () => { + test('env mode renders curl|bash with PMM_SERVER_URL and TECH', () => { const cmd = buildInstallCommand(baseOptions); expect(cmd).toContain("TECH='mysql'"); - expect(cmd).not.toContain('DB_PASSWORD='); - expect(cmd).not.toContain('DB_USER='); + expect(cmd).toContain("PMM_SERVER_URL='https://service_token:GLSA@pmm.example.com:443'"); expect(cmd).toContain('sudo -E env'); expect(cmd).toContain('curl -fsSLk'); expect(cmd).toContain('bash -s --'); expect(cmd).toContain('--pmm-server-insecure-tls'); - }); - - test('includes DB env in prompt mode when optional DB fields are set', () => { - const cmd = buildInstallCommand(optionsWithDb); - expect(cmd).toContain("DB_USER='pmm'"); - expect(cmd).toContain("DB_PASSWORD='secret'"); - expect(cmd).toContain("DB_HOST='127.0.0.1'"); - expect(cmd).toContain("DB_PORT='3306'"); - expect(cmd).toContain("DB_SERVICE_NAME='node-mysql'"); + expect(cmd).not.toContain('DB_USER='); + expect(cmd).not.toContain('DB_PASSWORD='); }); test('omits insecure TLS flag and drops curl -k when disabled', () => { @@ -153,6 +149,112 @@ describe('buildInstallCommand', () => { }); }); +describe('buildInstallCommand prompt mode', () => { + const promptBase: InstallCommandOptions = { + ...baseOptions, + credentialsMode: 'prompt', + }; + + test('renders a two-line curl-then-sudo-E-bash command', () => { + const cmd = buildInstallCommand(promptBase); + const lines = cmd.split('\n'); + expect(lines[0]).toContain( + "curl -fsSLk -o '/tmp/install-pmm-client.sh' 'https://pmm.example.com/pmm-static/install-pmm-client.sh'" + ); + expect(lines[1]).toMatch(/^sudo -E bash '\/tmp\/install-pmm-client\.sh' \\$/); + expect(cmd).not.toContain('curl |'); + expect(cmd).not.toContain('bash -s --'); + expect(cmd).not.toContain('sudo -E env'); + }); + + test('never emits DB credentials, even when fields are filled', () => { + const cmd = buildInstallCommand({ + ...promptBase, + dbUser: 'pmm', + dbPassword: 'secret', + }); + expect(cmd).not.toContain('DB_USER='); + expect(cmd).not.toContain('DB_PASSWORD='); + expect(cmd).not.toContain('--db-user'); + expect(cmd).not.toContain('--db-password'); + expect(cmd).not.toContain("'pmm'"); + expect(cmd).not.toContain("'secret'"); + }); + + test('emits non-credential DB fields as flags', () => { + const cmd = buildInstallCommand({ + ...promptBase, + dbHost: '127.0.0.1', + dbPort: '3306', + dbServiceName: 'node-mysql', + nodeName: 'node-1', + nodeAddress: '10.0.0.1', + }); + expect(cmd).toContain("--db-host '127.0.0.1'"); + expect(cmd).toContain("--db-port '3306'"); + expect(cmd).toContain("--db-service-name 'node-mysql'"); + expect(cmd).toContain("--node-name 'node-1'"); + expect(cmd).toContain("--node-address '10.0.0.1'"); + }); + + test('emits --db-name only for postgresql', () => { + const pg = buildInstallCommand({ + ...promptBase, + technology: 'postgresql', + dbName: 'postgres', + }); + const mysql = buildInstallCommand({ + ...promptBase, + technology: 'mysql', + dbName: 'postgres', + }); + expect(pg).toContain("--db-name 'postgres'"); + expect(mysql).not.toContain('--db-name'); + }); + + test('emits --db-auth-db only for mongodb', () => { + const mongo = buildInstallCommand({ + ...promptBase, + technology: 'mongodb', + dbAuthDB: 'admin', + }); + const mysql = buildInstallCommand({ + ...promptBase, + technology: 'mysql', + dbAuthDB: 'admin', + }); + expect(mongo).toContain("--db-auth-db 'admin'"); + expect(mysql).not.toContain('--db-auth-db'); + }); + + test('respects insecureTLS toggle for both curl and the script', () => { + const secure = buildInstallCommand({ ...promptBase, insecureTLS: false }); + const insecure = buildInstallCommand({ ...promptBase, insecureTLS: true }); + + expect(secure).toContain('curl -fsSL '); + expect(secure).not.toContain('curl -fsSLk'); + expect(secure).not.toContain('--pmm-server-insecure-tls'); + + expect(insecure).toContain('curl -fsSLk '); + expect(insecure).toContain('--pmm-server-insecure-tls'); + }); + + test('emits --pmm-server-url and --tech', () => { + const cmd = buildInstallCommand(promptBase); + expect(cmd).toContain( + "--pmm-server-url 'https://service_token:GLSA@pmm.example.com:443'" + ); + expect(cmd).toContain("--tech 'mysql'"); + }); + + test('emits --force when registerForce is on', () => { + const off = buildInstallCommand({ ...promptBase, registerForce: false }); + const on = buildInstallCommand({ ...promptBase, registerForce: true }); + expect(off).not.toContain('--force'); + expect(on).toContain('--force'); + }); +}); + describe('formatExpiresIn', () => { test('formats whole minutes with zero seconds', () => { expect(formatExpiresIn(15 * 60)).toBe('15:00'); diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts index 8c340c04c2f..d40bfb8bc2c 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts @@ -52,12 +52,79 @@ export interface InstallCommandOptions { export const shellEscape = (value: string): string => `'${value.replace(/'/g, `'\\''`)}'`; +// Where prompt mode tells the user to drop the downloaded script. /tmp is the +// only path we promise: it is universally writable and `bash ` works even +// when /tmp is mounted noexec (no exec bit needed, only read). Documented in +// one-step-ui-install.md; do not change without updating docs and tests. +const DOWNLOADED_SCRIPT_PATH = '/tmp/install-pmm-client.sh'; + +const curlDownloadFlags = (insecureTLS: boolean): string => + insecureTLS ? '-fsSLk' : '-fsSL'; + +// buildPromptModeCommand renders a two-step "download then sudo -E bash" command +// so the install script gets a real TTY on stdin. This is the only mode where +// `read -r -s` in install-pmm-client.sh can ask for DB user/password, so this +// branch must NEVER emit DB_USER / DB_PASSWORD or --db-user / --db-password — +// the script will prompt for them. Other optional fields (host, port, service +// name, MongoDB auth DB, PostgreSQL database) are still passed as flags so the +// user only types two things. +const buildPromptModeCommand = (opts: InstallCommandOptions): string => { + const curl = `curl ${curlDownloadFlags(opts.insecureTLS)} -o ${shellEscape( + DOWNLOADED_SCRIPT_PATH + )} ${shellEscape(opts.installerUrl)}`; + + const flags: string[] = [ + `--pmm-server-url ${shellEscape(opts.serverURL)}`, + `--tech ${shellEscape(opts.technology)}`, + ]; + if (opts.insecureTLS) { + flags.push('--pmm-server-insecure-tls'); + } + if (opts.registerForce) { + flags.push('--force'); + } + if (opts.nodeName.trim()) { + flags.push(`--node-name ${shellEscape(opts.nodeName.trim())}`); + } + if (opts.nodeAddress.trim()) { + flags.push(`--node-address ${shellEscape(opts.nodeAddress.trim())}`); + } + if (opts.dbHost.trim()) { + flags.push(`--db-host ${shellEscape(opts.dbHost.trim())}`); + } + if (opts.dbPort.trim()) { + flags.push(`--db-port ${shellEscape(opts.dbPort.trim())}`); + } + if (opts.dbServiceName.trim()) { + flags.push(`--db-service-name ${shellEscape(opts.dbServiceName.trim())}`); + } + if (opts.dbName.trim() && opts.technology === 'postgresql') { + flags.push(`--db-name ${shellEscape(opts.dbName.trim())}`); + } + if (opts.dbAuthDB.trim() && opts.technology === 'mongodb') { + flags.push(`--db-auth-db ${shellEscape(opts.dbAuthDB.trim())}`); + } + + // `sudo -E bash ` keeps stdin on the caller's TTY (same as plain sudo bash) + // while preserving the user's environment. install-pmm-client.sh maps + // DB_USER / DB_PASSWORD (and MYSQL_* / POSTGRESQL_* / …) before prompts; if + // those are already set, `prompt_if_empty` skips — so exports survive sudo. + return [ + curl, + `sudo -E bash ${shellEscape(DOWNLOADED_SCRIPT_PATH)} \\`, + ` ${flags.join(' \\\n ')}`, + ].join('\n'); +}; + export const buildInstallCommand = (opts: InstallCommandOptions): string => { + if (opts.credentialsMode === 'prompt') { + return buildPromptModeCommand(opts); + } + // -k is for the PMM Server certificate; emit it only when the user opted into // insecure TLS. With a properly signed cert we want curl to verify normally // (otherwise we'd be silently downgrading the security of every install). - const curlFlags = opts.insecureTLS ? '-fsSLk' : '-fsSL'; - const curl = `curl ${curlFlags} ${shellEscape(opts.installerUrl)}`; + const curl = `curl ${curlDownloadFlags(opts.insecureTLS)} ${shellEscape(opts.installerUrl)}`; const envVars: string[] = [ `PMM_SERVER_URL=${shellEscape(opts.serverURL)}`, @@ -80,20 +147,7 @@ export const buildInstallCommand = (opts: InstallCommandOptions): string => { scriptFlags.push('--force'); } - const emitDbEnvVars = - opts.credentialsMode === 'env' || - (opts.credentialsMode === 'prompt' && - Boolean( - opts.dbUser.trim() || - opts.dbPassword.trim() || - opts.dbHost.trim() || - opts.dbPort.trim() || - opts.dbServiceName.trim() || - opts.dbName.trim() || - opts.dbAuthDB.trim() - )); - - if (emitDbEnvVars) { + if (opts.credentialsMode === 'env') { if (opts.dbUser.trim()) { envVars.push(`DB_USER=${shellEscape(opts.dbUser.trim())}`); } From 4a8af1650d3dab63bfe0c834d2d7d7bb32c0b6fb Mon Sep 17 00:00:00 2001 From: theTibi Date: Mon, 4 May 2026 11:52:53 +0200 Subject: [PATCH 13/36] Update PMM Client Installation Documentation and UI for Credentials Modes - Adjusted the default credentials mode in the UI from 'env' to 'prompt', aligning with the updated documentation that emphasizes the security benefits of prompting for database credentials. - Enhanced the installation documentation to clarify the differences between the credentials modes, particularly focusing on the two-step command for prompt mode. - Updated UI components to reflect the new default and provide clearer guidance on the available options for credential handling. These changes improve the usability and security of the PMM client installation process. Signed-off-by: theTibi --- .../install-pmm/install-pmm-client/one-step-ui-install.md | 4 ++-- ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md b/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md index 2f56eb4de41..cf4dd2dfb3d 100644 --- a/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md +++ b/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md @@ -14,9 +14,9 @@ Use the **Install PMM Client** wizard to generate a single command that installs 2. Choose technology: `MySQL`, `PostgreSQL`, `MongoDB`, or `Valkey`. 3. Click **Generate short-lived token**. The countdown chip shows the remaining lifetime. 4. Select the credentials mode: - - **Include env variables (recommended for `curl | bash`)**: credentials are passed in the environment of the spawned shell. This is the default and works with the one-liner. + - **Prompt on node (downloads script first, asks for DB user/password)** (**default**): the wizard renders a **two-step** command — `curl … -o /tmp/install-pmm-client.sh ''` followed by `sudo -E bash /tmp/install-pmm-client.sh …`. Reading the script from disk (instead of piping it from `curl`) keeps stdin attached to your terminal, so the script can prompt you for the DB user and password. **`sudo -E`** preserves your environment into the root shell: if `DB_USER` / `DB_PASSWORD` (or per-tech `MYSQL_*`, `POSTGRESQL_*`, …) are already exported, the script uses them and **does not prompt**. Use this when you do not want credentials in the copied command line or process list from flags alone. + - **Include env variables (recommended for `curl | bash`)**: credentials are passed in the environment of the spawned shell. Use this when you want the classic one-liner pipeline. - **Pass as script flags**: credentials are passed as `--db-*` script arguments instead of env vars. Same security profile as env mode, just a different surface. - - **Prompt on node (downloads script first, asks for DB user/password)**: the wizard renders a **two-step** command — `curl … -o /tmp/install-pmm-client.sh ''` followed by `sudo -E bash /tmp/install-pmm-client.sh …`. Reading the script from disk (instead of piping it from `curl`) keeps stdin attached to your terminal, so the script can prompt you for the DB user and password. **`sudo -E`** preserves your environment into the root shell: if `DB_USER` / `DB_PASSWORD` (or per-tech `MYSQL_*`, `POSTGRESQL_*`, …) are already exported, the script uses them and **does not prompt**. Use this when you do not want credentials in the copied command line or process list from flags alone. 5. Fill in the optional fields you need (node name/address, DB host/port, service name, MongoDB auth DB, PostgreSQL database). 6. Copy the generated command and run it on the target node before the token expires. diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index a5770bc82d7..ed54ddab915 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -31,7 +31,7 @@ import { export const InstallClientPage = () => { const [technology, setTechnology] = useState('mysql'); - const [credentialsMode, setCredentialsMode] = useState('env'); + const [credentialsMode, setCredentialsMode] = useState('prompt'); const [token, setToken] = useState(''); const [pmmHost, setPmmHost] = useState(() => window.location.host); const [insecureTLS, setInsecureTLS] = useState(true); @@ -197,11 +197,11 @@ export const InstallClientPage = () => { setCredentialsMode(e.target.value as CredentialsMode) } > - Include env variables (recommended for curl | bash) - Pass as script flags Prompt on node (downloads script first, asks for DB user/password) + Include env variables (recommended for curl | bash) + Pass as script flags In prompt mode the rendered command is a two-liner: curl -o downloads From 1cd8fc714a116560fd9820b6ef476abeb2772b39 Mon Sep 17 00:00:00 2001 From: mattiasimonato Date: Wed, 6 May 2026 12:55:15 +0200 Subject: [PATCH 14/36] feat: add 'Preview' badge on navigation --- ui/apps/pmm/src/contexts/navigation/navigation.constants.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/apps/pmm/src/contexts/navigation/navigation.constants.ts b/ui/apps/pmm/src/contexts/navigation/navigation.constants.ts index b1ad5a00717..5a93c8a8fad 100644 --- a/ui/apps/pmm/src/contexts/navigation/navigation.constants.ts +++ b/ui/apps/pmm/src/contexts/navigation/navigation.constants.ts @@ -578,6 +578,11 @@ export const NAV_INVENTORY: NavItem = { text: 'Install PMM Client', url: `${PMM_NEW_NAV_PATH}/install-client`, matches: ['*'], + badge: { + label: 'Preview', + color: 'default', + variant: 'filled', + }, }, ], }; From cd0f4259a62ba6cf9c3768f88c102dac2e7706ec Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Wed, 6 May 2026 16:37:24 +0300 Subject: [PATCH 15/36] chore: regenerate the code --- api/accesscontrol/v1beta1/accesscontrol.pb.go | 46 +- .../v1beta1/accesscontrol.pb.validate.go | 2 - .../v1beta1/accesscontrol.swagger.json | 410 -- .../v1beta1/accesscontrol_grpc.pb.go | 7 + api/actions/v1/actions.pb.go | 84 +- api/actions/v1/actions.swagger.json | 737 --- api/actions/v1/actions_grpc.pb.go | 4 + api/advisors/v1/advisors.pb.go | 67 +- api/advisors/v1/advisors.pb.validate.go | 4 - api/advisors/v1/advisors.swagger.json | 539 -- api/advisors/v1/advisors_grpc.pb.go | 6 + api/agent/pb/agent.pb.go | 9 +- api/agent/pb/agent.swagger.json | 55 - api/agent/pb/agent_grpc.pb.go | 4 +- api/agent/v1/agent.pb.go | 233 +- api/agent/v1/agent.pb.validate.go | 1 - api/agent/v1/agent.swagger.json | 55 - api/agent/v1/agent_grpc.pb.go | 1 + api/agent/v1/collector.pb.go | 39 +- api/agent/v1/collector.swagger.json | 50 - api/agentlocal/v1/agentlocal.pb.go | 39 +- api/agentlocal/v1/agentlocal.swagger.json | 295 - api/agentlocal/v1/agentlocal_grpc.pb.go | 2 + api/alerting/v1/alerting.pb.go | 75 +- api/alerting/v1/alerting.pb.validate.go | 4 - api/alerting/v1/alerting.swagger.json | 581 -- api/alerting/v1/alerting_grpc.pb.go | 5 + api/alerting/v1/params.pb.go | 18 +- api/alerting/v1/params.swagger.json | 44 - api/backup/v1/artifacts.pb.go | 44 +- api/backup/v1/artifacts.swagger.json | 44 - api/backup/v1/backup.pb.go | 75 +- api/backup/v1/backup.swagger.json | 1003 ---- api/backup/v1/backup_grpc.pb.go | 10 + api/backup/v1/common.pb.go | 32 +- api/backup/v1/common.swagger.json | 44 - api/backup/v1/errors.pb.go | 20 +- api/backup/v1/errors.swagger.json | 44 - api/backup/v1/locations.pb.go | 42 +- api/backup/v1/locations.swagger.json | 353 -- api/backup/v1/locations_grpc.pb.go | 5 + api/backup/v1/restores.pb.go | 40 +- api/backup/v1/restores.swagger.json | 303 - api/backup/v1/restores_grpc.pb.go | 3 + api/common/common.pb.go | 20 +- api/common/common.swagger.json | 44 - api/common/metrics_resolutions.pb.go | 20 +- api/common/metrics_resolutions.swagger.json | 44 - api/dump/v1beta1/dump.pb.go | 48 +- api/dump/v1beta1/dump.swagger.json | 383 -- api/dump/v1beta1/dump_grpc.pb.go | 5 + api/ha/v1beta1/ha.pb.go | 30 +- api/ha/v1beta1/ha.swagger.json | 148 - api/ha/v1beta1/ha_grpc.pb.go | 2 + api/inventory/v1/agent_status.pb.go | 16 +- api/inventory/v1/agent_status.swagger.json | 44 - api/inventory/v1/agents.pb.go | 247 +- api/inventory/v1/agents.pb.validate.go | 38 - api/inventory/v1/agents.swagger.json | 4430 --------------- api/inventory/v1/agents_grpc.pb.go | 6 + api/inventory/v1/log_level.pb.go | 16 +- api/inventory/v1/log_level.swagger.json | 44 - api/inventory/v1/nodes.pb.go | 76 +- api/inventory/v1/nodes.swagger.json | 708 --- api/inventory/v1/nodes_grpc.pb.go | 4 + api/inventory/v1/services.pb.go | 109 +- api/inventory/v1/services.pb.validate.go | 2 - api/inventory/v1/services.swagger.json | 1189 ---- api/inventory/v1/services_grpc.pb.go | 6 + api/management/v1/agent.pb.go | 55 +- api/management/v1/agent.swagger.json | 44 - api/management/v1/annotation.pb.go | 20 +- api/management/v1/annotation.swagger.json | 44 - api/management/v1/azure.pb.go | 32 +- api/management/v1/azure.swagger.json | 44 - api/management/v1/external.pb.go | 33 +- api/management/v1/external.swagger.json | 44 - api/management/v1/haproxy.pb.go | 33 +- api/management/v1/haproxy.swagger.json | 44 - .../add_annotation_parameters.go | 2 - .../add_annotation_responses.go | 43 +- .../add_azure_database_parameters.go | 2 - .../add_azure_database_responses.go | 45 +- .../add_service_parameters.go | 2 - .../add_service_responses.go | 4510 ++++++++------- .../create_node_install_token_parameters.go | 2 - .../create_node_install_token_responses.go | 40 +- .../discover_azure_database_parameters.go | 2 - .../discover_azure_database_responses.go | 76 +- .../discover_rds_parameters.go | 2 - .../discover_rds_responses.go | 68 +- .../management_service/get_node_parameters.go | 2 - .../management_service/get_node_responses.go | 217 +- .../list_agent_versions_parameters.go | 1 - .../list_agent_versions_responses.go | 61 +- .../list_agents_parameters.go | 4 - .../list_agents_responses.go | 233 +- .../list_nodes_parameters.go | 7 +- .../list_nodes_responses.go | 219 +- .../list_services_parameters.go | 9 +- .../list_services_responses.go | 261 +- .../management_service_client.go | 154 +- .../register_node_parameters.go | 2 - .../register_node_responses.go | 192 +- .../remove_service_parameters.go | 7 +- .../remove_service_responses.go | 42 +- .../unregister_node_parameters.go | 3 - .../unregister_node_responses.go | 39 +- api/management/v1/json/v1.json | 4882 +++++++++-------- api/management/v1/metrics.pb.go | 16 +- api/management/v1/metrics.swagger.json | 44 - api/management/v1/mongodb.pb.go | 41 +- api/management/v1/mongodb.swagger.json | 44 - api/management/v1/mysql.pb.go | 41 +- api/management/v1/mysql.swagger.json | 44 - api/management/v1/node.pb.go | 69 +- api/management/v1/node.swagger.json | 44 - api/management/v1/postgresql.pb.go | 39 +- api/management/v1/postgresql.swagger.json | 44 - api/management/v1/proxysql.pb.go | 35 +- api/management/v1/proxysql.swagger.json | 44 - api/management/v1/rds.pb.go | 53 +- api/management/v1/rds.swagger.json | 44 - api/management/v1/service.pb.go | 121 +- api/management/v1/service.swagger.json | 4565 --------------- api/management/v1/service_grpc.pb.go | 14 + api/management/v1/severity.pb.go | 16 +- api/management/v1/severity.swagger.json | 44 - api/management/v1/valkey.pb.go | 35 +- api/management/v1/valkey.pb.validate.go | 4 - api/management/v1/valkey.swagger.json | 44 - api/qan/v1/collector.pb.go | 35 +- api/qan/v1/collector.swagger.json | 44 - api/qan/v1/collector_grpc.pb.go | 1 + api/qan/v1/filters.pb.go | 30 +- api/qan/v1/filters.swagger.json | 44 - api/qan/v1/object_details.pb.go | 76 +- api/qan/v1/object_details.swagger.json | 44 - api/qan/v1/profile.pb.go | 34 +- api/qan/v1/profile.swagger.json | 44 - api/qan/v1/qan.pb.go | 22 +- api/qan/v1/qan.swagger.json | 44 - api/qan/v1/service.pb.go | 66 +- api/qan/v1/service.swagger.json | 1568 ------ api/qan/v1/service_grpc.pb.go | 12 + api/realtimeanalytics/v1/collector.pb.go | 22 +- .../v1/collector.swagger.json | 44 - api/realtimeanalytics/v1/collector_grpc.pb.go | 1 + api/realtimeanalytics/v1/query.pb.go | 24 +- api/realtimeanalytics/v1/query.swagger.json | 44 - .../v1/realtimeanalytics.pb.go | 55 +- .../v1/realtimeanalytics.swagger.json | 516 -- .../v1/realtimeanalytics_grpc.pb.go | 6 + api/server/v1/httperror.pb.go | 20 +- api/server/v1/httperror.swagger.json | 46 - api/server/v1/server.pb.go | 81 +- api/server/v1/server.pb.validate.go | 2 - api/server/v1/server.swagger.json | 798 --- api/server/v1/server_grpc.pb.go | 10 + api/swagger/swagger-dev.json | 94 + api/swagger/swagger.json | 94 + api/uievents/v1/server.pb.go | 30 +- api/uievents/v1/server.pb.gw.go | 8 +- api/uievents/v1/server.swagger.json | 202 - api/uievents/v1/server_grpc.pb.go | 1 + api/user/v1/user.pb.go | 32 +- api/user/v1/user.swagger.json | 243 - api/user/v1/user_grpc.pb.go | 3 + managed/services/grafana/auth_server_test.go | 18 +- managed/services/grafana/client.go | 2 +- .../management/mock_grafana_client_test.go | 67 +- 171 files changed, 7675 insertions(+), 26976 deletions(-) delete mode 100644 api/accesscontrol/v1beta1/accesscontrol.swagger.json delete mode 100644 api/actions/v1/actions.swagger.json delete mode 100644 api/advisors/v1/advisors.swagger.json delete mode 100644 api/agent/pb/agent.swagger.json delete mode 100644 api/agent/v1/agent.swagger.json delete mode 100644 api/agent/v1/collector.swagger.json delete mode 100644 api/agentlocal/v1/agentlocal.swagger.json delete mode 100644 api/alerting/v1/alerting.swagger.json delete mode 100644 api/alerting/v1/params.swagger.json delete mode 100644 api/backup/v1/artifacts.swagger.json delete mode 100644 api/backup/v1/backup.swagger.json delete mode 100644 api/backup/v1/common.swagger.json delete mode 100644 api/backup/v1/errors.swagger.json delete mode 100644 api/backup/v1/locations.swagger.json delete mode 100644 api/backup/v1/restores.swagger.json delete mode 100644 api/common/common.swagger.json delete mode 100644 api/common/metrics_resolutions.swagger.json delete mode 100644 api/dump/v1beta1/dump.swagger.json delete mode 100644 api/ha/v1beta1/ha.swagger.json delete mode 100644 api/inventory/v1/agent_status.swagger.json delete mode 100644 api/inventory/v1/agents.swagger.json delete mode 100644 api/inventory/v1/log_level.swagger.json delete mode 100644 api/inventory/v1/nodes.swagger.json delete mode 100644 api/inventory/v1/services.swagger.json delete mode 100644 api/management/v1/agent.swagger.json delete mode 100644 api/management/v1/annotation.swagger.json delete mode 100644 api/management/v1/azure.swagger.json delete mode 100644 api/management/v1/external.swagger.json delete mode 100644 api/management/v1/haproxy.swagger.json delete mode 100644 api/management/v1/metrics.swagger.json delete mode 100644 api/management/v1/mongodb.swagger.json delete mode 100644 api/management/v1/mysql.swagger.json delete mode 100644 api/management/v1/node.swagger.json delete mode 100644 api/management/v1/postgresql.swagger.json delete mode 100644 api/management/v1/proxysql.swagger.json delete mode 100644 api/management/v1/rds.swagger.json delete mode 100644 api/management/v1/service.swagger.json delete mode 100644 api/management/v1/severity.swagger.json delete mode 100644 api/management/v1/valkey.swagger.json delete mode 100644 api/qan/v1/collector.swagger.json delete mode 100644 api/qan/v1/filters.swagger.json delete mode 100644 api/qan/v1/object_details.swagger.json delete mode 100644 api/qan/v1/profile.swagger.json delete mode 100644 api/qan/v1/qan.swagger.json delete mode 100644 api/qan/v1/service.swagger.json delete mode 100644 api/realtimeanalytics/v1/collector.swagger.json delete mode 100644 api/realtimeanalytics/v1/query.swagger.json delete mode 100644 api/realtimeanalytics/v1/realtimeanalytics.swagger.json delete mode 100644 api/server/v1/httperror.swagger.json delete mode 100644 api/server/v1/server.swagger.json delete mode 100644 api/uievents/v1/server.swagger.json delete mode 100644 api/user/v1/user.swagger.json diff --git a/api/accesscontrol/v1beta1/accesscontrol.pb.go b/api/accesscontrol/v1beta1/accesscontrol.pb.go index 639df37bd7e..f5e8ea4b004 100644 --- a/api/accesscontrol/v1beta1/accesscontrol.pb.go +++ b/api/accesscontrol/v1beta1/accesscontrol.pb.go @@ -7,14 +7,15 @@ package accesscontrolv1beta1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" ) const ( @@ -823,24 +824,27 @@ func file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP() []byte { return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescData } -var file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes = make([]protoimpl.MessageInfo, 15) -var file_accesscontrol_v1beta1_accesscontrol_proto_goTypes = []any{ - (*CreateRoleRequest)(nil), // 0: accesscontrol.v1beta1.CreateRoleRequest - (*CreateRoleResponse)(nil), // 1: accesscontrol.v1beta1.CreateRoleResponse - (*UpdateRoleRequest)(nil), // 2: accesscontrol.v1beta1.UpdateRoleRequest - (*UpdateRoleResponse)(nil), // 3: accesscontrol.v1beta1.UpdateRoleResponse - (*DeleteRoleRequest)(nil), // 4: accesscontrol.v1beta1.DeleteRoleRequest - (*DeleteRoleResponse)(nil), // 5: accesscontrol.v1beta1.DeleteRoleResponse - (*GetRoleRequest)(nil), // 6: accesscontrol.v1beta1.GetRoleRequest - (*GetRoleResponse)(nil), // 7: accesscontrol.v1beta1.GetRoleResponse - (*SetDefaultRoleRequest)(nil), // 8: accesscontrol.v1beta1.SetDefaultRoleRequest - (*SetDefaultRoleResponse)(nil), // 9: accesscontrol.v1beta1.SetDefaultRoleResponse - (*AssignRolesRequest)(nil), // 10: accesscontrol.v1beta1.AssignRolesRequest - (*AssignRolesResponse)(nil), // 11: accesscontrol.v1beta1.AssignRolesResponse - (*ListRolesRequest)(nil), // 12: accesscontrol.v1beta1.ListRolesRequest - (*ListRolesResponse)(nil), // 13: accesscontrol.v1beta1.ListRolesResponse - (*ListRolesResponse_RoleData)(nil), // 14: accesscontrol.v1beta1.ListRolesResponse.RoleData -} +var ( + file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes = make([]protoimpl.MessageInfo, 15) + file_accesscontrol_v1beta1_accesscontrol_proto_goTypes = []any{ + (*CreateRoleRequest)(nil), // 0: accesscontrol.v1beta1.CreateRoleRequest + (*CreateRoleResponse)(nil), // 1: accesscontrol.v1beta1.CreateRoleResponse + (*UpdateRoleRequest)(nil), // 2: accesscontrol.v1beta1.UpdateRoleRequest + (*UpdateRoleResponse)(nil), // 3: accesscontrol.v1beta1.UpdateRoleResponse + (*DeleteRoleRequest)(nil), // 4: accesscontrol.v1beta1.DeleteRoleRequest + (*DeleteRoleResponse)(nil), // 5: accesscontrol.v1beta1.DeleteRoleResponse + (*GetRoleRequest)(nil), // 6: accesscontrol.v1beta1.GetRoleRequest + (*GetRoleResponse)(nil), // 7: accesscontrol.v1beta1.GetRoleResponse + (*SetDefaultRoleRequest)(nil), // 8: accesscontrol.v1beta1.SetDefaultRoleRequest + (*SetDefaultRoleResponse)(nil), // 9: accesscontrol.v1beta1.SetDefaultRoleResponse + (*AssignRolesRequest)(nil), // 10: accesscontrol.v1beta1.AssignRolesRequest + (*AssignRolesResponse)(nil), // 11: accesscontrol.v1beta1.AssignRolesResponse + (*ListRolesRequest)(nil), // 12: accesscontrol.v1beta1.ListRolesRequest + (*ListRolesResponse)(nil), // 13: accesscontrol.v1beta1.ListRolesResponse + (*ListRolesResponse_RoleData)(nil), // 14: accesscontrol.v1beta1.ListRolesResponse.RoleData + } +) + var file_accesscontrol_v1beta1_accesscontrol_proto_depIdxs = []int32{ 14, // 0: accesscontrol.v1beta1.ListRolesResponse.roles:type_name -> accesscontrol.v1beta1.ListRolesResponse.RoleData 0, // 1: accesscontrol.v1beta1.AccessControlService.CreateRole:input_type -> accesscontrol.v1beta1.CreateRoleRequest diff --git a/api/accesscontrol/v1beta1/accesscontrol.pb.validate.go b/api/accesscontrol/v1beta1/accesscontrol.pb.validate.go index eb8ae6ba022..a055badfff2 100644 --- a/api/accesscontrol/v1beta1/accesscontrol.pb.validate.go +++ b/api/accesscontrol/v1beta1/accesscontrol.pb.validate.go @@ -290,7 +290,6 @@ func (m *UpdateRoleRequest) validate(all bool) error { } if m.Title != nil { - if utf8.RuneCountInString(m.GetTitle()) < 1 { err := UpdateRoleRequestValidationError{ field: "Title", @@ -301,7 +300,6 @@ func (m *UpdateRoleRequest) validate(all bool) error { } errors = append(errors, err) } - } if m.Filter != nil { diff --git a/api/accesscontrol/v1beta1/accesscontrol.swagger.json b/api/accesscontrol/v1beta1/accesscontrol.swagger.json deleted file mode 100644 index d9435ab700b..00000000000 --- a/api/accesscontrol/v1beta1/accesscontrol.swagger.json +++ /dev/null @@ -1,410 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "accesscontrol/v1beta1/accesscontrol.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "AccessControlService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/accesscontrol/roles": { - "get": { - "summary": "List Roles", - "description": "Lists all roles.", - "operationId": "ListRoles", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1ListRolesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "AccessControlService" - ] - }, - "post": { - "summary": "Create a Role", - "description": "Creates a new role.", - "operationId": "CreateRole", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1CreateRoleResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1beta1CreateRoleRequest" - } - } - ], - "tags": [ - "AccessControlService" - ] - } - }, - "/v1/accesscontrol/roles/{role_id}": { - "get": { - "summary": "Get a Role", - "description": "Retrieves a role by ID.", - "operationId": "GetRole", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1GetRoleResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "role_id", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "tags": [ - "AccessControlService" - ] - }, - "delete": { - "summary": "Delete a Role", - "description": "Deletes a role.", - "operationId": "DeleteRole", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1DeleteRoleResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "role_id", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "replacement_role_id", - "description": "Role ID to be used as a replacement for the role. Additional logic applies.", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "tags": [ - "AccessControlService" - ] - }, - "put": { - "summary": "Update a Role", - "description": "Updates an existing role.", - "operationId": "UpdateRole", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1UpdateRoleResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "role_id", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AccessControlServiceUpdateRoleBody" - } - } - ], - "tags": [ - "AccessControlService" - ] - } - }, - "/v1/accesscontrol/roles:assign": { - "post": { - "summary": "Assign Roles to a User", - "description": "Replaces all existing roles for a user.", - "operationId": "AssignRoles", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1AssignRolesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1beta1AssignRolesRequest" - } - } - ], - "tags": [ - "AccessControlService" - ] - } - }, - "/v1/accesscontrol/roles:setDefault": { - "post": { - "summary": "Set a Default Role", - "description": "Configures a default role assigned to users.", - "operationId": "SetDefaultRole", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1SetDefaultRoleResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1beta1SetDefaultRoleRequest" - } - } - ], - "tags": [ - "AccessControlService" - ] - } - } - }, - "definitions": { - "AccessControlServiceUpdateRoleBody": { - "type": "object", - "properties": { - "title": { - "type": "string", - "x-nullable": true - }, - "filter": { - "type": "string", - "x-nullable": true - }, - "description": { - "type": "string", - "x-nullable": true - } - } - }, - "ListRolesResponseRoleData": { - "type": "object", - "properties": { - "role_id": { - "type": "integer", - "format": "int64" - }, - "title": { - "type": "string" - }, - "filter": { - "type": "string" - }, - "description": { - "type": "string" - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1beta1AssignRolesRequest": { - "type": "object", - "properties": { - "role_ids": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - "user_id": { - "type": "integer", - "format": "int64" - } - } - }, - "v1beta1AssignRolesResponse": { - "type": "object" - }, - "v1beta1CreateRoleRequest": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "filter": { - "type": "string" - }, - "description": { - "type": "string" - } - } - }, - "v1beta1CreateRoleResponse": { - "type": "object", - "properties": { - "role_id": { - "type": "integer", - "format": "int64" - } - } - }, - "v1beta1DeleteRoleResponse": { - "type": "object" - }, - "v1beta1GetRoleResponse": { - "type": "object", - "properties": { - "role_id": { - "type": "integer", - "format": "int64" - }, - "title": { - "type": "string" - }, - "filter": { - "type": "string" - }, - "description": { - "type": "string" - } - } - }, - "v1beta1ListRolesResponse": { - "type": "object", - "properties": { - "roles": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/ListRolesResponseRoleData" - } - } - } - }, - "v1beta1SetDefaultRoleRequest": { - "type": "object", - "properties": { - "role_id": { - "type": "integer", - "format": "int64" - } - } - }, - "v1beta1SetDefaultRoleResponse": { - "type": "object" - }, - "v1beta1UpdateRoleResponse": { - "type": "object" - } - } -} diff --git a/api/accesscontrol/v1beta1/accesscontrol_grpc.pb.go b/api/accesscontrol/v1beta1/accesscontrol_grpc.pb.go index f868b277a03..27f509ee6f5 100644 --- a/api/accesscontrol/v1beta1/accesscontrol_grpc.pb.go +++ b/api/accesscontrol/v1beta1/accesscontrol_grpc.pb.go @@ -8,6 +8,7 @@ package accesscontrolv1beta1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -161,21 +162,27 @@ type UnimplementedAccessControlServiceServer struct{} func (UnimplementedAccessControlServiceServer) CreateRole(context.Context, *CreateRoleRequest) (*CreateRoleResponse, error) { return nil, status.Error(codes.Unimplemented, "method CreateRole not implemented") } + func (UnimplementedAccessControlServiceServer) UpdateRole(context.Context, *UpdateRoleRequest) (*UpdateRoleResponse, error) { return nil, status.Error(codes.Unimplemented, "method UpdateRole not implemented") } + func (UnimplementedAccessControlServiceServer) DeleteRole(context.Context, *DeleteRoleRequest) (*DeleteRoleResponse, error) { return nil, status.Error(codes.Unimplemented, "method DeleteRole not implemented") } + func (UnimplementedAccessControlServiceServer) GetRole(context.Context, *GetRoleRequest) (*GetRoleResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetRole not implemented") } + func (UnimplementedAccessControlServiceServer) ListRoles(context.Context, *ListRolesRequest) (*ListRolesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListRoles not implemented") } + func (UnimplementedAccessControlServiceServer) AssignRoles(context.Context, *AssignRolesRequest) (*AssignRolesResponse, error) { return nil, status.Error(codes.Unimplemented, "method AssignRoles not implemented") } + func (UnimplementedAccessControlServiceServer) SetDefaultRole(context.Context, *SetDefaultRoleRequest) (*SetDefaultRoleResponse, error) { return nil, status.Error(codes.Unimplemented, "method SetDefaultRole not implemented") } diff --git a/api/actions/v1/actions.pb.go b/api/actions/v1/actions.pb.go index c22f9dab1a2..8cc8bdac9e8 100644 --- a/api/actions/v1/actions.pb.go +++ b/api/actions/v1/actions.pb.go @@ -7,14 +7,15 @@ package actionsv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" ) const ( @@ -2609,43 +2610,46 @@ func file_actions_v1_actions_proto_rawDescGZIP() []byte { return file_actions_v1_actions_proto_rawDescData } -var file_actions_v1_actions_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_actions_v1_actions_proto_msgTypes = make([]protoimpl.MessageInfo, 32) -var file_actions_v1_actions_proto_goTypes = []any{ - (ActionType)(0), // 0: actions.v1.ActionType - (*GetActionRequest)(nil), // 1: actions.v1.GetActionRequest - (*GetActionResponse)(nil), // 2: actions.v1.GetActionResponse - (*StartMySQLExplainActionParams)(nil), // 3: actions.v1.StartMySQLExplainActionParams - (*StartMySQLExplainActionResult)(nil), // 4: actions.v1.StartMySQLExplainActionResult - (*StartMySQLExplainJSONActionParams)(nil), // 5: actions.v1.StartMySQLExplainJSONActionParams - (*StartMySQLExplainJSONActionResult)(nil), // 6: actions.v1.StartMySQLExplainJSONActionResult - (*StartMySQLExplainTraditionalJSONActionParams)(nil), // 7: actions.v1.StartMySQLExplainTraditionalJSONActionParams - (*StartMySQLExplainTraditionalJSONActionResult)(nil), // 8: actions.v1.StartMySQLExplainTraditionalJSONActionResult - (*StartMySQLShowCreateTableActionParams)(nil), // 9: actions.v1.StartMySQLShowCreateTableActionParams - (*StartMySQLShowCreateTableActionResult)(nil), // 10: actions.v1.StartMySQLShowCreateTableActionResult - (*StartMySQLShowTableStatusActionParams)(nil), // 11: actions.v1.StartMySQLShowTableStatusActionParams - (*StartMySQLShowTableStatusActionResult)(nil), // 12: actions.v1.StartMySQLShowTableStatusActionResult - (*StartMySQLShowIndexActionParams)(nil), // 13: actions.v1.StartMySQLShowIndexActionParams - (*StartMySQLShowIndexActionResult)(nil), // 14: actions.v1.StartMySQLShowIndexActionResult - (*StartPostgreSQLShowCreateTableActionParams)(nil), // 15: actions.v1.StartPostgreSQLShowCreateTableActionParams - (*StartPostgreSQLShowCreateTableActionResult)(nil), // 16: actions.v1.StartPostgreSQLShowCreateTableActionResult - (*StartPostgreSQLShowIndexActionParams)(nil), // 17: actions.v1.StartPostgreSQLShowIndexActionParams - (*StartPostgreSQLShowIndexActionResult)(nil), // 18: actions.v1.StartPostgreSQLShowIndexActionResult - (*StartMongoDBExplainActionParams)(nil), // 19: actions.v1.StartMongoDBExplainActionParams - (*StartMongoDBExplainActionResult)(nil), // 20: actions.v1.StartMongoDBExplainActionResult - (*StartPTPgSummaryActionParams)(nil), // 21: actions.v1.StartPTPgSummaryActionParams - (*StartPTPgSummaryActionResult)(nil), // 22: actions.v1.StartPTPgSummaryActionResult - (*StartPTMongoDBSummaryActionParams)(nil), // 23: actions.v1.StartPTMongoDBSummaryActionParams - (*StartPTMongoDBSummaryActionResult)(nil), // 24: actions.v1.StartPTMongoDBSummaryActionResult - (*StartPTMySQLSummaryActionParams)(nil), // 25: actions.v1.StartPTMySQLSummaryActionParams - (*StartPTMySQLSummaryActionResult)(nil), // 26: actions.v1.StartPTMySQLSummaryActionResult - (*StartPTSummaryActionRequest)(nil), // 27: actions.v1.StartPTSummaryActionRequest - (*StartPTSummaryActionResponse)(nil), // 28: actions.v1.StartPTSummaryActionResponse - (*CancelActionRequest)(nil), // 29: actions.v1.CancelActionRequest - (*CancelActionResponse)(nil), // 30: actions.v1.CancelActionResponse - (*StartServiceActionRequest)(nil), // 31: actions.v1.StartServiceActionRequest - (*StartServiceActionResponse)(nil), // 32: actions.v1.StartServiceActionResponse -} +var ( + file_actions_v1_actions_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_actions_v1_actions_proto_msgTypes = make([]protoimpl.MessageInfo, 32) + file_actions_v1_actions_proto_goTypes = []any{ + (ActionType)(0), // 0: actions.v1.ActionType + (*GetActionRequest)(nil), // 1: actions.v1.GetActionRequest + (*GetActionResponse)(nil), // 2: actions.v1.GetActionResponse + (*StartMySQLExplainActionParams)(nil), // 3: actions.v1.StartMySQLExplainActionParams + (*StartMySQLExplainActionResult)(nil), // 4: actions.v1.StartMySQLExplainActionResult + (*StartMySQLExplainJSONActionParams)(nil), // 5: actions.v1.StartMySQLExplainJSONActionParams + (*StartMySQLExplainJSONActionResult)(nil), // 6: actions.v1.StartMySQLExplainJSONActionResult + (*StartMySQLExplainTraditionalJSONActionParams)(nil), // 7: actions.v1.StartMySQLExplainTraditionalJSONActionParams + (*StartMySQLExplainTraditionalJSONActionResult)(nil), // 8: actions.v1.StartMySQLExplainTraditionalJSONActionResult + (*StartMySQLShowCreateTableActionParams)(nil), // 9: actions.v1.StartMySQLShowCreateTableActionParams + (*StartMySQLShowCreateTableActionResult)(nil), // 10: actions.v1.StartMySQLShowCreateTableActionResult + (*StartMySQLShowTableStatusActionParams)(nil), // 11: actions.v1.StartMySQLShowTableStatusActionParams + (*StartMySQLShowTableStatusActionResult)(nil), // 12: actions.v1.StartMySQLShowTableStatusActionResult + (*StartMySQLShowIndexActionParams)(nil), // 13: actions.v1.StartMySQLShowIndexActionParams + (*StartMySQLShowIndexActionResult)(nil), // 14: actions.v1.StartMySQLShowIndexActionResult + (*StartPostgreSQLShowCreateTableActionParams)(nil), // 15: actions.v1.StartPostgreSQLShowCreateTableActionParams + (*StartPostgreSQLShowCreateTableActionResult)(nil), // 16: actions.v1.StartPostgreSQLShowCreateTableActionResult + (*StartPostgreSQLShowIndexActionParams)(nil), // 17: actions.v1.StartPostgreSQLShowIndexActionParams + (*StartPostgreSQLShowIndexActionResult)(nil), // 18: actions.v1.StartPostgreSQLShowIndexActionResult + (*StartMongoDBExplainActionParams)(nil), // 19: actions.v1.StartMongoDBExplainActionParams + (*StartMongoDBExplainActionResult)(nil), // 20: actions.v1.StartMongoDBExplainActionResult + (*StartPTPgSummaryActionParams)(nil), // 21: actions.v1.StartPTPgSummaryActionParams + (*StartPTPgSummaryActionResult)(nil), // 22: actions.v1.StartPTPgSummaryActionResult + (*StartPTMongoDBSummaryActionParams)(nil), // 23: actions.v1.StartPTMongoDBSummaryActionParams + (*StartPTMongoDBSummaryActionResult)(nil), // 24: actions.v1.StartPTMongoDBSummaryActionResult + (*StartPTMySQLSummaryActionParams)(nil), // 25: actions.v1.StartPTMySQLSummaryActionParams + (*StartPTMySQLSummaryActionResult)(nil), // 26: actions.v1.StartPTMySQLSummaryActionResult + (*StartPTSummaryActionRequest)(nil), // 27: actions.v1.StartPTSummaryActionRequest + (*StartPTSummaryActionResponse)(nil), // 28: actions.v1.StartPTSummaryActionResponse + (*CancelActionRequest)(nil), // 29: actions.v1.CancelActionRequest + (*CancelActionResponse)(nil), // 30: actions.v1.CancelActionResponse + (*StartServiceActionRequest)(nil), // 31: actions.v1.StartServiceActionRequest + (*StartServiceActionResponse)(nil), // 32: actions.v1.StartServiceActionResponse + } +) + var file_actions_v1_actions_proto_depIdxs = []int32{ 3, // 0: actions.v1.StartServiceActionRequest.mysql_explain:type_name -> actions.v1.StartMySQLExplainActionParams 5, // 1: actions.v1.StartServiceActionRequest.mysql_explain_json:type_name -> actions.v1.StartMySQLExplainJSONActionParams diff --git a/api/actions/v1/actions.swagger.json b/api/actions/v1/actions.swagger.json deleted file mode 100644 index 04404da66a7..00000000000 --- a/api/actions/v1/actions.swagger.json +++ /dev/null @@ -1,737 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "actions/v1/actions.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "ActionsService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/actions/{action_id}": { - "get": { - "summary": "Get Action", - "description": "Gets the result of a given Action.", - "operationId": "GetAction", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetActionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "action_id", - "description": "Unique Action ID.", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "ActionsService" - ] - } - }, - "/v1/actions:cancelAction": { - "post": { - "summary": "Cancel an Action", - "description": "Stops an Action.", - "operationId": "CancelAction", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1CancelActionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1CancelActionRequest" - } - } - ], - "tags": [ - "ActionsService" - ] - } - }, - "/v1/actions:startNodeAction": { - "post": { - "summary": "Start 'PT Summary' Action", - "description": "Starts 'Percona Toolkit Summary' Action.", - "operationId": "StartPTSummaryAction", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1StartPTSummaryActionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1StartPTSummaryActionRequest" - } - } - ], - "tags": [ - "ActionsService" - ] - } - }, - "/v1/actions:startServiceAction": { - "post": { - "summary": "Start a Service Action", - "description": "Starts a Service Action.", - "operationId": "StartServiceAction", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1StartServiceActionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1StartServiceActionRequest" - } - } - ], - "tags": [ - "ActionsService" - ] - } - } - }, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1CancelActionRequest": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID. Required." - } - } - }, - "v1CancelActionResponse": { - "type": "object" - }, - "v1GetActionResponse": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where this Action is running / was run." - }, - "output": { - "type": "string", - "description": "Current Action output; may be partial if Action is still running." - }, - "done": { - "type": "boolean", - "description": "True if Action is finished." - }, - "error": { - "type": "string", - "description": "Error message if Action failed." - } - } - }, - "v1StartMongoDBExplainActionParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to run this Action." - }, - "service_id": { - "type": "string", - "description": "Service ID for this Action. Required." - }, - "query": { - "type": "string", - "description": "Query. Required." - } - } - }, - "v1StartMongoDBExplainActionResult": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to this Action was started." - } - } - }, - "v1StartMySQLExplainActionParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to run this Action." - }, - "service_id": { - "type": "string", - "description": "Service ID for this Action. Required." - }, - "query_id": { - "type": "string", - "description": "Query ID of query." - }, - "placeholders": { - "type": "array", - "items": { - "type": "string" - }, - "title": "Array of placeholder values" - }, - "database": { - "type": "string", - "description": "Database name. Required if it can't be deduced from the query ID." - } - } - }, - "v1StartMySQLExplainActionResult": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to this Action was started." - } - } - }, - "v1StartMySQLExplainJSONActionParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to run this Action." - }, - "service_id": { - "type": "string", - "description": "Service ID for this Action. Required." - }, - "query_id": { - "type": "string", - "description": "Query ID of query." - }, - "placeholders": { - "type": "array", - "items": { - "type": "string" - }, - "title": "Array of placeholder values" - }, - "database": { - "type": "string", - "description": "Database name. Required if it can't be deduced from the query ID." - } - } - }, - "v1StartMySQLExplainJSONActionResult": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to this Action was started." - } - } - }, - "v1StartMySQLExplainTraditionalJSONActionParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to run this Action." - }, - "service_id": { - "type": "string", - "description": "Service ID for this Action. Required." - }, - "query_id": { - "type": "string", - "description": "Query ID of query." - }, - "placeholders": { - "type": "array", - "items": { - "type": "string" - }, - "title": "Array of placeholder values" - }, - "database": { - "type": "string", - "description": "Database name. Required if it can't be deduced from the query ID." - } - } - }, - "v1StartMySQLExplainTraditionalJSONActionResult": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to this Action was started." - } - } - }, - "v1StartMySQLShowCreateTableActionParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to run this Action." - }, - "service_id": { - "type": "string", - "description": "Service ID for this Action. Required." - }, - "table_name": { - "type": "string", - "description": "Table name. Required. May additionally contain a database name." - }, - "database": { - "type": "string", - "description": "Database name. Required if not given in the table_name field." - } - } - }, - "v1StartMySQLShowCreateTableActionResult": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to this Action was started." - } - } - }, - "v1StartMySQLShowIndexActionParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to run this Action." - }, - "service_id": { - "type": "string", - "description": "Service ID for this Action. Required." - }, - "table_name": { - "type": "string", - "description": "Table name. Required. May additionally contain a database name." - }, - "database": { - "type": "string", - "description": "Database name. Required if not given in the table_name field." - } - } - }, - "v1StartMySQLShowIndexActionResult": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to this Action was started." - } - } - }, - "v1StartMySQLShowTableStatusActionParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to run this Action." - }, - "service_id": { - "type": "string", - "description": "Service ID for this Action. Required." - }, - "table_name": { - "type": "string", - "description": "Table name. Required. May additionally contain a database name." - }, - "database": { - "type": "string", - "description": "Database name. Required if not given in the table_name field." - } - } - }, - "v1StartMySQLShowTableStatusActionResult": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to this Action was started." - } - } - }, - "v1StartPTMongoDBSummaryActionParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to run this Action." - }, - "service_id": { - "type": "string", - "description": "Service ID for this Action." - } - }, - "title": "Message to prepare pt-mongodb-summary data" - }, - "v1StartPTMongoDBSummaryActionResult": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to this Action was started." - } - }, - "title": "Message to retrieve the prepared pt-mongodb-summary data" - }, - "v1StartPTMySQLSummaryActionParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to run this Action." - }, - "service_id": { - "type": "string", - "description": "Service ID for this Action." - } - }, - "title": "Message to prepare pt-mysql-summary data" - }, - "v1StartPTMySQLSummaryActionResult": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to this Action was started." - } - }, - "title": "Message to retrieve the prepared pt-mysql-summary data" - }, - "v1StartPTPgSummaryActionParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to run this Action." - }, - "service_id": { - "type": "string", - "description": "Service ID for this Action." - } - }, - "title": "Message to prepare pt-pg-summary data" - }, - "v1StartPTPgSummaryActionResult": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to this Action was started." - } - }, - "title": "Message to retrieve the prepared pt-pg-summary data" - }, - "v1StartPTSummaryActionRequest": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to run this Action." - }, - "node_id": { - "type": "string", - "description": "Node ID for this Action." - } - } - }, - "v1StartPTSummaryActionResponse": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to this Action was started." - } - } - }, - "v1StartPostgreSQLShowCreateTableActionParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to run this Action." - }, - "service_id": { - "type": "string", - "description": "Service ID for this Action. Required." - }, - "table_name": { - "type": "string", - "description": "Table name. Required. May additionally contain a database name." - }, - "database": { - "type": "string", - "description": "Database name. Required if not given in the table_name field." - } - } - }, - "v1StartPostgreSQLShowCreateTableActionResult": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to this Action was started." - } - } - }, - "v1StartPostgreSQLShowIndexActionParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to run this Action." - }, - "service_id": { - "type": "string", - "description": "Service ID for this Action. Required." - }, - "table_name": { - "type": "string", - "description": "Table name. Required. May additionally contain a database name." - }, - "database": { - "type": "string", - "description": "Database name. Required if not given in the table_name field." - } - } - }, - "v1StartPostgreSQLShowIndexActionResult": { - "type": "object", - "properties": { - "action_id": { - "type": "string", - "description": "Unique Action ID." - }, - "pmm_agent_id": { - "type": "string", - "description": "pmm-agent ID where to this Action was started." - } - } - }, - "v1StartServiceActionRequest": { - "type": "object", - "properties": { - "mysql_explain": { - "$ref": "#/definitions/v1StartMySQLExplainActionParams" - }, - "mysql_explain_json": { - "$ref": "#/definitions/v1StartMySQLExplainJSONActionParams" - }, - "mysql_explain_traditional_json": { - "$ref": "#/definitions/v1StartMySQLExplainTraditionalJSONActionParams" - }, - "mysql_show_index": { - "$ref": "#/definitions/v1StartMySQLShowIndexActionParams" - }, - "mysql_show_create_table": { - "$ref": "#/definitions/v1StartMySQLShowCreateTableActionParams" - }, - "mysql_show_table_status": { - "$ref": "#/definitions/v1StartMySQLShowTableStatusActionParams" - }, - "postgres_show_create_table": { - "$ref": "#/definitions/v1StartPostgreSQLShowCreateTableActionParams" - }, - "postgres_show_index": { - "$ref": "#/definitions/v1StartPostgreSQLShowIndexActionParams" - }, - "mongodb_explain": { - "$ref": "#/definitions/v1StartMongoDBExplainActionParams" - }, - "pt_mongodb_summary": { - "$ref": "#/definitions/v1StartPTMongoDBSummaryActionParams" - }, - "pt_mysql_summary": { - "$ref": "#/definitions/v1StartPTMySQLSummaryActionParams" - }, - "pt_postgres_summary": { - "$ref": "#/definitions/v1StartPTPgSummaryActionParams" - } - } - }, - "v1StartServiceActionResponse": { - "type": "object", - "properties": { - "mysql_explain": { - "$ref": "#/definitions/v1StartMySQLExplainActionResult" - }, - "mysql_explain_json": { - "$ref": "#/definitions/v1StartMySQLExplainJSONActionResult" - }, - "mysql_explain_traditional_json": { - "$ref": "#/definitions/v1StartMySQLExplainTraditionalJSONActionResult" - }, - "mysql_show_index": { - "$ref": "#/definitions/v1StartMySQLShowIndexActionResult" - }, - "mysql_show_create_table": { - "$ref": "#/definitions/v1StartMySQLShowCreateTableActionResult" - }, - "mysql_show_table_status": { - "$ref": "#/definitions/v1StartMySQLShowTableStatusActionResult" - }, - "postgresql_show_create_table": { - "$ref": "#/definitions/v1StartPostgreSQLShowCreateTableActionResult" - }, - "postgresql_show_index": { - "$ref": "#/definitions/v1StartPostgreSQLShowIndexActionResult" - }, - "mongodb_explain": { - "$ref": "#/definitions/v1StartMongoDBExplainActionResult" - }, - "pt_mongodb_summary": { - "$ref": "#/definitions/v1StartPTMongoDBSummaryActionResult" - }, - "pt_mysql_summary": { - "$ref": "#/definitions/v1StartPTMySQLSummaryActionResult" - }, - "pt_postgres_summary": { - "$ref": "#/definitions/v1StartPTPgSummaryActionResult" - } - } - } - } -} diff --git a/api/actions/v1/actions_grpc.pb.go b/api/actions/v1/actions_grpc.pb.go index f9fb5ad5c81..cfe06386498 100644 --- a/api/actions/v1/actions_grpc.pb.go +++ b/api/actions/v1/actions_grpc.pb.go @@ -8,6 +8,7 @@ package actionsv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -116,12 +117,15 @@ type UnimplementedActionsServiceServer struct{} func (UnimplementedActionsServiceServer) GetAction(context.Context, *GetActionRequest) (*GetActionResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetAction not implemented") } + func (UnimplementedActionsServiceServer) StartServiceAction(context.Context, *StartServiceActionRequest) (*StartServiceActionResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartServiceAction not implemented") } + func (UnimplementedActionsServiceServer) StartPTSummaryAction(context.Context, *StartPTSummaryActionRequest) (*StartPTSummaryActionResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartPTSummaryAction not implemented") } + func (UnimplementedActionsServiceServer) CancelAction(context.Context, *CancelActionRequest) (*CancelActionResponse, error) { return nil, status.Error(codes.Unimplemented, "method CancelAction not implemented") } diff --git a/api/advisors/v1/advisors.pb.go b/api/advisors/v1/advisors.pb.go index e86ccdfcea8..1961afd6e44 100644 --- a/api/advisors/v1/advisors.pb.go +++ b/api/advisors/v1/advisors.pb.go @@ -7,15 +7,17 @@ package advisorsv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - v1 "github.com/percona/pmm/api/management/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" + + v1 "github.com/percona/pmm/api/management/v1" ) const ( @@ -1356,33 +1358,36 @@ func file_advisors_v1_advisors_proto_rawDescGZIP() []byte { return file_advisors_v1_advisors_proto_rawDescData } -var file_advisors_v1_advisors_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_advisors_v1_advisors_proto_msgTypes = make([]protoimpl.MessageInfo, 20) -var file_advisors_v1_advisors_proto_goTypes = []any{ - (AdvisorCheckInterval)(0), // 0: advisors.v1.AdvisorCheckInterval - (AdvisorCheckFamily)(0), // 1: advisors.v1.AdvisorCheckFamily - (*AdvisorCheckResult)(nil), // 2: advisors.v1.AdvisorCheckResult - (*CheckResultSummary)(nil), // 3: advisors.v1.CheckResultSummary - (*CheckResult)(nil), // 4: advisors.v1.CheckResult - (*AdvisorCheck)(nil), // 5: advisors.v1.AdvisorCheck - (*Advisor)(nil), // 6: advisors.v1.Advisor - (*ChangeAdvisorCheckParams)(nil), // 7: advisors.v1.ChangeAdvisorCheckParams - (*StartAdvisorChecksRequest)(nil), // 8: advisors.v1.StartAdvisorChecksRequest - (*StartAdvisorChecksResponse)(nil), // 9: advisors.v1.StartAdvisorChecksResponse - (*ListAdvisorChecksRequest)(nil), // 10: advisors.v1.ListAdvisorChecksRequest - (*ListAdvisorChecksResponse)(nil), // 11: advisors.v1.ListAdvisorChecksResponse - (*ListAdvisorsRequest)(nil), // 12: advisors.v1.ListAdvisorsRequest - (*ListAdvisorsResponse)(nil), // 13: advisors.v1.ListAdvisorsResponse - (*ChangeAdvisorChecksRequest)(nil), // 14: advisors.v1.ChangeAdvisorChecksRequest - (*ChangeAdvisorChecksResponse)(nil), // 15: advisors.v1.ChangeAdvisorChecksResponse - (*ListFailedServicesRequest)(nil), // 16: advisors.v1.ListFailedServicesRequest - (*ListFailedServicesResponse)(nil), // 17: advisors.v1.ListFailedServicesResponse - (*GetFailedChecksRequest)(nil), // 18: advisors.v1.GetFailedChecksRequest - (*GetFailedChecksResponse)(nil), // 19: advisors.v1.GetFailedChecksResponse - nil, // 20: advisors.v1.AdvisorCheckResult.LabelsEntry - nil, // 21: advisors.v1.CheckResult.LabelsEntry - (v1.Severity)(0), // 22: management.v1.Severity -} +var ( + file_advisors_v1_advisors_proto_enumTypes = make([]protoimpl.EnumInfo, 2) + file_advisors_v1_advisors_proto_msgTypes = make([]protoimpl.MessageInfo, 20) + file_advisors_v1_advisors_proto_goTypes = []any{ + (AdvisorCheckInterval)(0), // 0: advisors.v1.AdvisorCheckInterval + (AdvisorCheckFamily)(0), // 1: advisors.v1.AdvisorCheckFamily + (*AdvisorCheckResult)(nil), // 2: advisors.v1.AdvisorCheckResult + (*CheckResultSummary)(nil), // 3: advisors.v1.CheckResultSummary + (*CheckResult)(nil), // 4: advisors.v1.CheckResult + (*AdvisorCheck)(nil), // 5: advisors.v1.AdvisorCheck + (*Advisor)(nil), // 6: advisors.v1.Advisor + (*ChangeAdvisorCheckParams)(nil), // 7: advisors.v1.ChangeAdvisorCheckParams + (*StartAdvisorChecksRequest)(nil), // 8: advisors.v1.StartAdvisorChecksRequest + (*StartAdvisorChecksResponse)(nil), // 9: advisors.v1.StartAdvisorChecksResponse + (*ListAdvisorChecksRequest)(nil), // 10: advisors.v1.ListAdvisorChecksRequest + (*ListAdvisorChecksResponse)(nil), // 11: advisors.v1.ListAdvisorChecksResponse + (*ListAdvisorsRequest)(nil), // 12: advisors.v1.ListAdvisorsRequest + (*ListAdvisorsResponse)(nil), // 13: advisors.v1.ListAdvisorsResponse + (*ChangeAdvisorChecksRequest)(nil), // 14: advisors.v1.ChangeAdvisorChecksRequest + (*ChangeAdvisorChecksResponse)(nil), // 15: advisors.v1.ChangeAdvisorChecksResponse + (*ListFailedServicesRequest)(nil), // 16: advisors.v1.ListFailedServicesRequest + (*ListFailedServicesResponse)(nil), // 17: advisors.v1.ListFailedServicesResponse + (*GetFailedChecksRequest)(nil), // 18: advisors.v1.GetFailedChecksRequest + (*GetFailedChecksResponse)(nil), // 19: advisors.v1.GetFailedChecksResponse + nil, // 20: advisors.v1.AdvisorCheckResult.LabelsEntry + nil, // 21: advisors.v1.CheckResult.LabelsEntry + (v1.Severity)(0), // 22: management.v1.Severity + } +) + var file_advisors_v1_advisors_proto_depIdxs = []int32{ 22, // 0: advisors.v1.AdvisorCheckResult.severity:type_name -> management.v1.Severity 20, // 1: advisors.v1.AdvisorCheckResult.labels:type_name -> advisors.v1.AdvisorCheckResult.LabelsEntry diff --git a/api/advisors/v1/advisors.pb.validate.go b/api/advisors/v1/advisors.pb.validate.go index 2c9a192edc4..ef8f8500241 100644 --- a/api/advisors/v1/advisors.pb.validate.go +++ b/api/advisors/v1/advisors.pb.validate.go @@ -1937,7 +1937,6 @@ func (m *GetFailedChecksRequest) validate(all bool) error { // no validation rules for ServiceId if m.PageSize != nil { - if m.GetPageSize() < 1 { err := GetFailedChecksRequestValidationError{ field: "PageSize", @@ -1948,11 +1947,9 @@ func (m *GetFailedChecksRequest) validate(all bool) error { } errors = append(errors, err) } - } if m.PageIndex != nil { - if m.GetPageIndex() < 0 { err := GetFailedChecksRequestValidationError{ field: "PageIndex", @@ -1963,7 +1960,6 @@ func (m *GetFailedChecksRequest) validate(all bool) error { } errors = append(errors, err) } - } if len(errors) > 0 { diff --git a/api/advisors/v1/advisors.swagger.json b/api/advisors/v1/advisors.swagger.json deleted file mode 100644 index 5cb79b42b6c..00000000000 --- a/api/advisors/v1/advisors.swagger.json +++ /dev/null @@ -1,539 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "advisors/v1/advisors.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "AdvisorService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/advisors": { - "get": { - "summary": "List Advisors", - "description": "List advisors available to the user.", - "operationId": "ListAdvisors", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListAdvisorsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "AdvisorService" - ] - } - }, - "/v1/advisors/checks": { - "get": { - "summary": "List Advisor Checks", - "description": "List advisor checks available to the user.", - "operationId": "ListAdvisorChecks", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListAdvisorChecksResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "AdvisorService" - ] - } - }, - "/v1/advisors/checks/failed": { - "get": { - "summary": "Get Failed Advisor Checks", - "description": "Returns the latest check results for a given service.", - "operationId": "GetFailedChecks", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetFailedChecksResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "page_size", - "description": "Maximum number of results per page.", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "page_index", - "description": "Index of the requested page, starts from 0.", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "service_id", - "description": "Service ID.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "AdvisorService" - ] - } - }, - "/v1/advisors/checks:batchChange": { - "post": { - "summary": "Change Advisor Checks", - "description": "Enables/disables advisor checks or changes their exec interval.", - "operationId": "ChangeAdvisorChecks", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ChangeAdvisorChecksResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1ChangeAdvisorChecksRequest" - } - } - ], - "tags": [ - "AdvisorService" - ] - } - }, - "/v1/advisors/checks:start": { - "post": { - "summary": "Start Advisor Checks", - "description": "Executes Advisor checks and returns when all checks are executed. All available checks will be started if check names aren't specified.", - "operationId": "StartAdvisorChecks", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1StartAdvisorChecksResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1StartAdvisorChecksRequest" - } - } - ], - "tags": [ - "AdvisorService" - ] - } - }, - "/v1/advisors/failedServices": { - "get": { - "summary": "List Failed Services", - "description": "Returns a list of services with failed checks and a summary of check results.", - "operationId": "ListFailedServices", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListFailedServicesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "AdvisorService" - ] - } - } - }, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1Advisor": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Machine-readable name (ID) that is used in expression." - }, - "description": { - "type": "string", - "description": "Long human-readable description." - }, - "summary": { - "type": "string", - "description": "Short human-readable summary." - }, - "comment": { - "type": "string", - "description": "Comment." - }, - "category": { - "type": "string", - "description": "Category." - }, - "checks": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1AdvisorCheck" - }, - "description": "Advisor checks." - } - } - }, - "v1AdvisorCheck": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Machine-readable name (ID) that is used in expression." - }, - "enabled": { - "type": "boolean", - "description": "True if that check is enabled." - }, - "description": { - "type": "string", - "description": "Long human-readable description." - }, - "summary": { - "type": "string", - "description": "Short human-readable summary." - }, - "interval": { - "$ref": "#/definitions/v1AdvisorCheckInterval", - "description": "Check execution interval." - }, - "family": { - "$ref": "#/definitions/v1AdvisorCheckFamily", - "description": "DB family." - } - }, - "description": "AdvisorCheck contains check name and status." - }, - "v1AdvisorCheckFamily": { - "type": "string", - "enum": [ - "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - "ADVISOR_CHECK_FAMILY_MYSQL", - "ADVISOR_CHECK_FAMILY_POSTGRESQL", - "ADVISOR_CHECK_FAMILY_MONGODB" - ], - "default": "ADVISOR_CHECK_FAMILY_UNSPECIFIED" - }, - "v1AdvisorCheckInterval": { - "type": "string", - "enum": [ - "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "ADVISOR_CHECK_INTERVAL_STANDARD", - "ADVISOR_CHECK_INTERVAL_FREQUENT", - "ADVISOR_CHECK_INTERVAL_RARE" - ], - "default": "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "description": "AdvisorCheckInterval represents possible execution interval values for checks." - }, - "v1ChangeAdvisorCheckParams": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the check to change." - }, - "enable": { - "type": "boolean", - "x-nullable": true - }, - "interval": { - "$ref": "#/definitions/v1AdvisorCheckInterval", - "description": "check execution interval." - } - }, - "description": "ChangeAdvisorCheckParams specifies a single check parameters." - }, - "v1ChangeAdvisorChecksRequest": { - "type": "object", - "properties": { - "params": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1ChangeAdvisorCheckParams" - } - } - } - }, - "v1ChangeAdvisorChecksResponse": { - "type": "object" - }, - "v1CheckResult": { - "type": "object", - "properties": { - "summary": { - "type": "string" - }, - "description": { - "type": "string" - }, - "severity": { - "$ref": "#/definitions/v1Severity" - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "read_more_url": { - "type": "string", - "description": "URL containing information on how to resolve an issue detected by an Advisor check." - }, - "service_name": { - "type": "string", - "description": "Name of the monitored service on which the check ran." - }, - "service_id": { - "type": "string", - "description": "ID of the monitored service on which the check ran." - }, - "check_name": { - "type": "string", - "title": "Name of the check that failed" - }, - "silenced": { - "type": "boolean", - "title": "Silence status of the check result" - } - }, - "description": "CheckResult represents the check results for a given service." - }, - "v1CheckResultSummary": { - "type": "object", - "properties": { - "service_name": { - "type": "string" - }, - "service_id": { - "type": "string" - }, - "emergency_count": { - "type": "integer", - "format": "int64", - "description": "Number of failed checks for this service with severity level \"EMERGENCY\"." - }, - "alert_count": { - "type": "integer", - "format": "int64", - "description": "Number of failed checks for this service with severity level \"ALERT\"." - }, - "critical_count": { - "type": "integer", - "format": "int64", - "description": "Number of failed checks for this service with severity level \"CRITICAL\"." - }, - "error_count": { - "type": "integer", - "format": "int64", - "description": "Number of failed checks for this service with severity level \"ERROR\"." - }, - "warning_count": { - "type": "integer", - "format": "int64", - "description": "Number of failed checks for this service with severity level \"WARNING\"." - }, - "notice_count": { - "type": "integer", - "format": "int64", - "description": "Number of failed checks for this service with severity level \"NOTICE\"." - }, - "info_count": { - "type": "integer", - "format": "int64", - "description": "Number of failed checks for this service with severity level \"INFO\"." - }, - "debug_count": { - "type": "integer", - "format": "int64", - "description": "Number of failed checks for this service with severity level \"DEBUG\"." - } - }, - "description": "CheckResultSummary is a summary of check results." - }, - "v1GetFailedChecksResponse": { - "type": "object", - "properties": { - "total_items": { - "type": "integer", - "format": "int32", - "description": "Total number of results." - }, - "total_pages": { - "type": "integer", - "format": "int32", - "description": "Total number of pages." - }, - "results": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1CheckResult" - }, - "title": "Check results" - } - } - }, - "v1ListAdvisorChecksResponse": { - "type": "object", - "properties": { - "checks": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1AdvisorCheck" - } - } - } - }, - "v1ListAdvisorsResponse": { - "type": "object", - "properties": { - "advisors": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Advisor" - } - } - } - }, - "v1ListFailedServicesResponse": { - "type": "object", - "properties": { - "result": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1CheckResultSummary" - } - } - } - }, - "v1Severity": { - "type": "string", - "enum": [ - "SEVERITY_UNSPECIFIED", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "default": "SEVERITY_UNSPECIFIED", - "description": "Severity represents severity level of the check result or alert." - }, - "v1StartAdvisorChecksRequest": { - "type": "object", - "properties": { - "names": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Names of the checks that should be started." - } - } - }, - "v1StartAdvisorChecksResponse": { - "type": "object" - } - } -} diff --git a/api/advisors/v1/advisors_grpc.pb.go b/api/advisors/v1/advisors_grpc.pb.go index b5a99aa9d13..968dd072fc8 100644 --- a/api/advisors/v1/advisors_grpc.pb.go +++ b/api/advisors/v1/advisors_grpc.pb.go @@ -8,6 +8,7 @@ package advisorsv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -146,18 +147,23 @@ type UnimplementedAdvisorServiceServer struct{} func (UnimplementedAdvisorServiceServer) ListFailedServices(context.Context, *ListFailedServicesRequest) (*ListFailedServicesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListFailedServices not implemented") } + func (UnimplementedAdvisorServiceServer) GetFailedChecks(context.Context, *GetFailedChecksRequest) (*GetFailedChecksResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetFailedChecks not implemented") } + func (UnimplementedAdvisorServiceServer) StartAdvisorChecks(context.Context, *StartAdvisorChecksRequest) (*StartAdvisorChecksResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartAdvisorChecks not implemented") } + func (UnimplementedAdvisorServiceServer) ListAdvisorChecks(context.Context, *ListAdvisorChecksRequest) (*ListAdvisorChecksResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAdvisorChecks not implemented") } + func (UnimplementedAdvisorServiceServer) ListAdvisors(context.Context, *ListAdvisorsRequest) (*ListAdvisorsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAdvisors not implemented") } + func (UnimplementedAdvisorServiceServer) ChangeAdvisorChecks(context.Context, *ChangeAdvisorChecksRequest) (*ChangeAdvisorChecksResponse, error) { return nil, status.Error(codes.Unimplemented, "method ChangeAdvisorChecks not implemented") } diff --git a/api/agent/pb/agent.pb.go b/api/agent/pb/agent.pb.go index 3e266018313..cfe97cee491 100644 --- a/api/agent/pb/agent.pb.go +++ b/api/agent/pb/agent.pb.go @@ -7,11 +7,13 @@ package pb import ( - v1 "github.com/percona/pmm/api/agent/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + v1 "github.com/percona/pmm/api/agent/v1" ) const ( @@ -35,6 +37,7 @@ var file_agent_pb_agent_proto_goTypes = []any{ (*v1.AgentMessage)(nil), // 0: agent.v1.AgentMessage (*v1.ServerMessage)(nil), // 1: agent.v1.ServerMessage } + var file_agent_pb_agent_proto_depIdxs = []int32{ 0, // 0: agent.Agent.Connect:input_type -> agent.v1.AgentMessage 1, // 1: agent.Agent.Connect:output_type -> agent.v1.ServerMessage diff --git a/api/agent/pb/agent.swagger.json b/api/agent/pb/agent.swagger.json deleted file mode 100644 index 5c75bc6dbe5..00000000000 --- a/api/agent/pb/agent.swagger.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "agent/pb/agent.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "Agent" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - } - }, - "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client." - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - }, - "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." - } - }, - "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." - } - } -} diff --git a/api/agent/pb/agent_grpc.pb.go b/api/agent/pb/agent_grpc.pb.go index 591479ea96f..6755a51892e 100644 --- a/api/agent/pb/agent_grpc.pb.go +++ b/api/agent/pb/agent_grpc.pb.go @@ -8,10 +8,12 @@ package pb import ( context "context" - v1 "github.com/percona/pmm/api/agent/v1" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + + v1 "github.com/percona/pmm/api/agent/v1" ) // This is a compile-time assertion to ensure that this generated file diff --git a/api/agent/v1/agent.pb.go b/api/agent/v1/agent.pb.go index 134579c7352..9169133a80d 100644 --- a/api/agent/v1/agent.pb.go +++ b/api/agent/v1/agent.pb.go @@ -7,16 +7,18 @@ package agentv1 import ( - v11 "github.com/percona/pmm/api/backup/v1" - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" + status "google.golang.org/genproto/googleapis/rpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" + + v11 "github.com/percona/pmm/api/backup/v1" + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -7107,115 +7109,118 @@ func file_agent_v1_agent_proto_rawDescGZIP() []byte { return file_agent_v1_agent_proto_rawDescData } -var file_agent_v1_agent_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_agent_v1_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 92) -var file_agent_v1_agent_proto_goTypes = []any{ - (MysqlExplainOutputFormat)(0), // 0: agent.v1.MysqlExplainOutputFormat - (StartActionRequest_RestartSystemServiceParams_SystemService)(0), // 1: agent.v1.StartActionRequest.RestartSystemServiceParams.SystemService - (*TextFiles)(nil), // 2: agent.v1.TextFiles - (*Ping)(nil), // 3: agent.v1.Ping - (*Pong)(nil), // 4: agent.v1.Pong - (*QANCollectRequest)(nil), // 5: agent.v1.QANCollectRequest - (*QANCollectResponse)(nil), // 6: agent.v1.QANCollectResponse - (*StateChangedRequest)(nil), // 7: agent.v1.StateChangedRequest - (*StateChangedResponse)(nil), // 8: agent.v1.StateChangedResponse - (*SetStateRequest)(nil), // 9: agent.v1.SetStateRequest - (*SetStateResponse)(nil), // 10: agent.v1.SetStateResponse - (*QueryActionValue)(nil), // 11: agent.v1.QueryActionValue - (*QueryActionSlice)(nil), // 12: agent.v1.QueryActionSlice - (*QueryActionMap)(nil), // 13: agent.v1.QueryActionMap - (*QueryActionBinary)(nil), // 14: agent.v1.QueryActionBinary - (*QueryActionResult)(nil), // 15: agent.v1.QueryActionResult - (*StartActionRequest)(nil), // 16: agent.v1.StartActionRequest - (*StartActionResponse)(nil), // 17: agent.v1.StartActionResponse - (*StopActionRequest)(nil), // 18: agent.v1.StopActionRequest - (*StopActionResponse)(nil), // 19: agent.v1.StopActionResponse - (*ActionResultRequest)(nil), // 20: agent.v1.ActionResultRequest - (*ActionResultResponse)(nil), // 21: agent.v1.ActionResultResponse - (*PBMSwitchPITRRequest)(nil), // 22: agent.v1.PBMSwitchPITRRequest - (*PBMSwitchPITRResponse)(nil), // 23: agent.v1.PBMSwitchPITRResponse - (*AgentLogsRequest)(nil), // 24: agent.v1.AgentLogsRequest - (*AgentLogsResponse)(nil), // 25: agent.v1.AgentLogsResponse - (*CheckConnectionRequest)(nil), // 26: agent.v1.CheckConnectionRequest - (*CheckConnectionResponse)(nil), // 27: agent.v1.CheckConnectionResponse - (*ServiceInfoRequest)(nil), // 28: agent.v1.ServiceInfoRequest - (*ServiceInfoResponse)(nil), // 29: agent.v1.ServiceInfoResponse - (*JobStatusRequest)(nil), // 30: agent.v1.JobStatusRequest - (*JobStatusResponse)(nil), // 31: agent.v1.JobStatusResponse - (*S3LocationConfig)(nil), // 32: agent.v1.S3LocationConfig - (*FilesystemLocationConfig)(nil), // 33: agent.v1.FilesystemLocationConfig - (*StartJobRequest)(nil), // 34: agent.v1.StartJobRequest - (*StartJobResponse)(nil), // 35: agent.v1.StartJobResponse - (*StopJobRequest)(nil), // 36: agent.v1.StopJobRequest - (*StopJobResponse)(nil), // 37: agent.v1.StopJobResponse - (*JobResult)(nil), // 38: agent.v1.JobResult - (*JobProgress)(nil), // 39: agent.v1.JobProgress - (*GetVersionsRequest)(nil), // 40: agent.v1.GetVersionsRequest - (*GetVersionsResponse)(nil), // 41: agent.v1.GetVersionsResponse - (*AgentMessage)(nil), // 42: agent.v1.AgentMessage - (*ServerMessage)(nil), // 43: agent.v1.ServerMessage - nil, // 44: agent.v1.TextFiles.FilesEntry - (*SetStateRequest_AgentProcess)(nil), // 45: agent.v1.SetStateRequest.AgentProcess - nil, // 46: agent.v1.SetStateRequest.AgentProcessesEntry - (*SetStateRequest_BuiltinAgent)(nil), // 47: agent.v1.SetStateRequest.BuiltinAgent - nil, // 48: agent.v1.SetStateRequest.BuiltinAgentsEntry - nil, // 49: agent.v1.SetStateRequest.AgentProcess.TextFilesEntry - nil, // 50: agent.v1.SetStateRequest.BuiltinAgent.EnvEntry - nil, // 51: agent.v1.QueryActionMap.MapEntry - (*StartActionRequest_MySQLExplainParams)(nil), // 52: agent.v1.StartActionRequest.MySQLExplainParams - (*StartActionRequest_MySQLShowCreateTableParams)(nil), // 53: agent.v1.StartActionRequest.MySQLShowCreateTableParams - (*StartActionRequest_MySQLShowTableStatusParams)(nil), // 54: agent.v1.StartActionRequest.MySQLShowTableStatusParams - (*StartActionRequest_MySQLShowIndexParams)(nil), // 55: agent.v1.StartActionRequest.MySQLShowIndexParams - (*StartActionRequest_PostgreSQLShowCreateTableParams)(nil), // 56: agent.v1.StartActionRequest.PostgreSQLShowCreateTableParams - (*StartActionRequest_PostgreSQLShowIndexParams)(nil), // 57: agent.v1.StartActionRequest.PostgreSQLShowIndexParams - (*StartActionRequest_MongoDBExplainParams)(nil), // 58: agent.v1.StartActionRequest.MongoDBExplainParams - (*StartActionRequest_PTSummaryParams)(nil), // 59: agent.v1.StartActionRequest.PTSummaryParams - (*StartActionRequest_PTPgSummaryParams)(nil), // 60: agent.v1.StartActionRequest.PTPgSummaryParams - (*StartActionRequest_PTMongoDBSummaryParams)(nil), // 61: agent.v1.StartActionRequest.PTMongoDBSummaryParams - (*StartActionRequest_PTMySQLSummaryParams)(nil), // 62: agent.v1.StartActionRequest.PTMySQLSummaryParams - (*StartActionRequest_MySQLQueryShowParams)(nil), // 63: agent.v1.StartActionRequest.MySQLQueryShowParams - (*StartActionRequest_MySQLQuerySelectParams)(nil), // 64: agent.v1.StartActionRequest.MySQLQuerySelectParams - (*StartActionRequest_PostgreSQLQueryShowParams)(nil), // 65: agent.v1.StartActionRequest.PostgreSQLQueryShowParams - (*StartActionRequest_PostgreSQLQuerySelectParams)(nil), // 66: agent.v1.StartActionRequest.PostgreSQLQuerySelectParams - (*StartActionRequest_MongoDBQueryGetParameterParams)(nil), // 67: agent.v1.StartActionRequest.MongoDBQueryGetParameterParams - (*StartActionRequest_MongoDBQueryBuildInfoParams)(nil), // 68: agent.v1.StartActionRequest.MongoDBQueryBuildInfoParams - (*StartActionRequest_MongoDBQueryGetCmdLineOptsParams)(nil), // 69: agent.v1.StartActionRequest.MongoDBQueryGetCmdLineOptsParams - (*StartActionRequest_MongoDBQueryReplSetGetStatusParams)(nil), // 70: agent.v1.StartActionRequest.MongoDBQueryReplSetGetStatusParams - (*StartActionRequest_MongoDBQueryGetDiagnosticDataParams)(nil), // 71: agent.v1.StartActionRequest.MongoDBQueryGetDiagnosticDataParams - (*StartActionRequest_RestartSystemServiceParams)(nil), // 72: agent.v1.StartActionRequest.RestartSystemServiceParams - (*CheckConnectionResponse_Stats)(nil), // 73: agent.v1.CheckConnectionResponse.Stats - (*StartJobRequest_MySQLBackup)(nil), // 74: agent.v1.StartJobRequest.MySQLBackup - (*StartJobRequest_MySQLRestoreBackup)(nil), // 75: agent.v1.StartJobRequest.MySQLRestoreBackup - (*StartJobRequest_MongoDBBackup)(nil), // 76: agent.v1.StartJobRequest.MongoDBBackup - (*StartJobRequest_MongoDBRestoreBackup)(nil), // 77: agent.v1.StartJobRequest.MongoDBRestoreBackup - (*JobResult_Error)(nil), // 78: agent.v1.JobResult.Error - (*JobResult_MongoDBBackup)(nil), // 79: agent.v1.JobResult.MongoDBBackup - (*JobResult_MySQLBackup)(nil), // 80: agent.v1.JobResult.MySQLBackup - (*JobResult_MySQLRestoreBackup)(nil), // 81: agent.v1.JobResult.MySQLRestoreBackup - (*JobResult_MongoDBRestoreBackup)(nil), // 82: agent.v1.JobResult.MongoDBRestoreBackup - (*JobProgress_MySQLBackup)(nil), // 83: agent.v1.JobProgress.MySQLBackup - (*JobProgress_MySQLRestoreBackup)(nil), // 84: agent.v1.JobProgress.MySQLRestoreBackup - (*JobProgress_Logs)(nil), // 85: agent.v1.JobProgress.Logs - (*GetVersionsRequest_MySQLd)(nil), // 86: agent.v1.GetVersionsRequest.MySQLd - (*GetVersionsRequest_Xtrabackup)(nil), // 87: agent.v1.GetVersionsRequest.Xtrabackup - (*GetVersionsRequest_Xbcloud)(nil), // 88: agent.v1.GetVersionsRequest.Xbcloud - (*GetVersionsRequest_Qpress)(nil), // 89: agent.v1.GetVersionsRequest.Qpress - (*GetVersionsRequest_MongoDB)(nil), // 90: agent.v1.GetVersionsRequest.MongoDB - (*GetVersionsRequest_PBM)(nil), // 91: agent.v1.GetVersionsRequest.PBM - (*GetVersionsRequest_Software)(nil), // 92: agent.v1.GetVersionsRequest.Software - (*GetVersionsResponse_Version)(nil), // 93: agent.v1.GetVersionsResponse.Version - (*timestamppb.Timestamp)(nil), // 94: google.protobuf.Timestamp - (*MetricsBucket)(nil), // 95: agent.v1.MetricsBucket - (v1.AgentStatus)(0), // 96: inventory.v1.AgentStatus - (*durationpb.Duration)(nil), // 97: google.protobuf.Duration - (v1.ServiceType)(0), // 98: inventory.v1.ServiceType - (*status.Status)(nil), // 99: google.rpc.Status - (v1.AgentType)(0), // 100: inventory.v1.AgentType - (*v1.RTAOptions)(nil), // 101: inventory.v1.RTAOptions - (v11.DataModel)(0), // 102: backup.v1.DataModel - (*v11.PbmMetadata)(nil), // 103: backup.v1.PbmMetadata - (*v11.Metadata)(nil), // 104: backup.v1.Metadata -} +var ( + file_agent_v1_agent_proto_enumTypes = make([]protoimpl.EnumInfo, 2) + file_agent_v1_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 92) + file_agent_v1_agent_proto_goTypes = []any{ + (MysqlExplainOutputFormat)(0), // 0: agent.v1.MysqlExplainOutputFormat + (StartActionRequest_RestartSystemServiceParams_SystemService)(0), // 1: agent.v1.StartActionRequest.RestartSystemServiceParams.SystemService + (*TextFiles)(nil), // 2: agent.v1.TextFiles + (*Ping)(nil), // 3: agent.v1.Ping + (*Pong)(nil), // 4: agent.v1.Pong + (*QANCollectRequest)(nil), // 5: agent.v1.QANCollectRequest + (*QANCollectResponse)(nil), // 6: agent.v1.QANCollectResponse + (*StateChangedRequest)(nil), // 7: agent.v1.StateChangedRequest + (*StateChangedResponse)(nil), // 8: agent.v1.StateChangedResponse + (*SetStateRequest)(nil), // 9: agent.v1.SetStateRequest + (*SetStateResponse)(nil), // 10: agent.v1.SetStateResponse + (*QueryActionValue)(nil), // 11: agent.v1.QueryActionValue + (*QueryActionSlice)(nil), // 12: agent.v1.QueryActionSlice + (*QueryActionMap)(nil), // 13: agent.v1.QueryActionMap + (*QueryActionBinary)(nil), // 14: agent.v1.QueryActionBinary + (*QueryActionResult)(nil), // 15: agent.v1.QueryActionResult + (*StartActionRequest)(nil), // 16: agent.v1.StartActionRequest + (*StartActionResponse)(nil), // 17: agent.v1.StartActionResponse + (*StopActionRequest)(nil), // 18: agent.v1.StopActionRequest + (*StopActionResponse)(nil), // 19: agent.v1.StopActionResponse + (*ActionResultRequest)(nil), // 20: agent.v1.ActionResultRequest + (*ActionResultResponse)(nil), // 21: agent.v1.ActionResultResponse + (*PBMSwitchPITRRequest)(nil), // 22: agent.v1.PBMSwitchPITRRequest + (*PBMSwitchPITRResponse)(nil), // 23: agent.v1.PBMSwitchPITRResponse + (*AgentLogsRequest)(nil), // 24: agent.v1.AgentLogsRequest + (*AgentLogsResponse)(nil), // 25: agent.v1.AgentLogsResponse + (*CheckConnectionRequest)(nil), // 26: agent.v1.CheckConnectionRequest + (*CheckConnectionResponse)(nil), // 27: agent.v1.CheckConnectionResponse + (*ServiceInfoRequest)(nil), // 28: agent.v1.ServiceInfoRequest + (*ServiceInfoResponse)(nil), // 29: agent.v1.ServiceInfoResponse + (*JobStatusRequest)(nil), // 30: agent.v1.JobStatusRequest + (*JobStatusResponse)(nil), // 31: agent.v1.JobStatusResponse + (*S3LocationConfig)(nil), // 32: agent.v1.S3LocationConfig + (*FilesystemLocationConfig)(nil), // 33: agent.v1.FilesystemLocationConfig + (*StartJobRequest)(nil), // 34: agent.v1.StartJobRequest + (*StartJobResponse)(nil), // 35: agent.v1.StartJobResponse + (*StopJobRequest)(nil), // 36: agent.v1.StopJobRequest + (*StopJobResponse)(nil), // 37: agent.v1.StopJobResponse + (*JobResult)(nil), // 38: agent.v1.JobResult + (*JobProgress)(nil), // 39: agent.v1.JobProgress + (*GetVersionsRequest)(nil), // 40: agent.v1.GetVersionsRequest + (*GetVersionsResponse)(nil), // 41: agent.v1.GetVersionsResponse + (*AgentMessage)(nil), // 42: agent.v1.AgentMessage + (*ServerMessage)(nil), // 43: agent.v1.ServerMessage + nil, // 44: agent.v1.TextFiles.FilesEntry + (*SetStateRequest_AgentProcess)(nil), // 45: agent.v1.SetStateRequest.AgentProcess + nil, // 46: agent.v1.SetStateRequest.AgentProcessesEntry + (*SetStateRequest_BuiltinAgent)(nil), // 47: agent.v1.SetStateRequest.BuiltinAgent + nil, // 48: agent.v1.SetStateRequest.BuiltinAgentsEntry + nil, // 49: agent.v1.SetStateRequest.AgentProcess.TextFilesEntry + nil, // 50: agent.v1.SetStateRequest.BuiltinAgent.EnvEntry + nil, // 51: agent.v1.QueryActionMap.MapEntry + (*StartActionRequest_MySQLExplainParams)(nil), // 52: agent.v1.StartActionRequest.MySQLExplainParams + (*StartActionRequest_MySQLShowCreateTableParams)(nil), // 53: agent.v1.StartActionRequest.MySQLShowCreateTableParams + (*StartActionRequest_MySQLShowTableStatusParams)(nil), // 54: agent.v1.StartActionRequest.MySQLShowTableStatusParams + (*StartActionRequest_MySQLShowIndexParams)(nil), // 55: agent.v1.StartActionRequest.MySQLShowIndexParams + (*StartActionRequest_PostgreSQLShowCreateTableParams)(nil), // 56: agent.v1.StartActionRequest.PostgreSQLShowCreateTableParams + (*StartActionRequest_PostgreSQLShowIndexParams)(nil), // 57: agent.v1.StartActionRequest.PostgreSQLShowIndexParams + (*StartActionRequest_MongoDBExplainParams)(nil), // 58: agent.v1.StartActionRequest.MongoDBExplainParams + (*StartActionRequest_PTSummaryParams)(nil), // 59: agent.v1.StartActionRequest.PTSummaryParams + (*StartActionRequest_PTPgSummaryParams)(nil), // 60: agent.v1.StartActionRequest.PTPgSummaryParams + (*StartActionRequest_PTMongoDBSummaryParams)(nil), // 61: agent.v1.StartActionRequest.PTMongoDBSummaryParams + (*StartActionRequest_PTMySQLSummaryParams)(nil), // 62: agent.v1.StartActionRequest.PTMySQLSummaryParams + (*StartActionRequest_MySQLQueryShowParams)(nil), // 63: agent.v1.StartActionRequest.MySQLQueryShowParams + (*StartActionRequest_MySQLQuerySelectParams)(nil), // 64: agent.v1.StartActionRequest.MySQLQuerySelectParams + (*StartActionRequest_PostgreSQLQueryShowParams)(nil), // 65: agent.v1.StartActionRequest.PostgreSQLQueryShowParams + (*StartActionRequest_PostgreSQLQuerySelectParams)(nil), // 66: agent.v1.StartActionRequest.PostgreSQLQuerySelectParams + (*StartActionRequest_MongoDBQueryGetParameterParams)(nil), // 67: agent.v1.StartActionRequest.MongoDBQueryGetParameterParams + (*StartActionRequest_MongoDBQueryBuildInfoParams)(nil), // 68: agent.v1.StartActionRequest.MongoDBQueryBuildInfoParams + (*StartActionRequest_MongoDBQueryGetCmdLineOptsParams)(nil), // 69: agent.v1.StartActionRequest.MongoDBQueryGetCmdLineOptsParams + (*StartActionRequest_MongoDBQueryReplSetGetStatusParams)(nil), // 70: agent.v1.StartActionRequest.MongoDBQueryReplSetGetStatusParams + (*StartActionRequest_MongoDBQueryGetDiagnosticDataParams)(nil), // 71: agent.v1.StartActionRequest.MongoDBQueryGetDiagnosticDataParams + (*StartActionRequest_RestartSystemServiceParams)(nil), // 72: agent.v1.StartActionRequest.RestartSystemServiceParams + (*CheckConnectionResponse_Stats)(nil), // 73: agent.v1.CheckConnectionResponse.Stats + (*StartJobRequest_MySQLBackup)(nil), // 74: agent.v1.StartJobRequest.MySQLBackup + (*StartJobRequest_MySQLRestoreBackup)(nil), // 75: agent.v1.StartJobRequest.MySQLRestoreBackup + (*StartJobRequest_MongoDBBackup)(nil), // 76: agent.v1.StartJobRequest.MongoDBBackup + (*StartJobRequest_MongoDBRestoreBackup)(nil), // 77: agent.v1.StartJobRequest.MongoDBRestoreBackup + (*JobResult_Error)(nil), // 78: agent.v1.JobResult.Error + (*JobResult_MongoDBBackup)(nil), // 79: agent.v1.JobResult.MongoDBBackup + (*JobResult_MySQLBackup)(nil), // 80: agent.v1.JobResult.MySQLBackup + (*JobResult_MySQLRestoreBackup)(nil), // 81: agent.v1.JobResult.MySQLRestoreBackup + (*JobResult_MongoDBRestoreBackup)(nil), // 82: agent.v1.JobResult.MongoDBRestoreBackup + (*JobProgress_MySQLBackup)(nil), // 83: agent.v1.JobProgress.MySQLBackup + (*JobProgress_MySQLRestoreBackup)(nil), // 84: agent.v1.JobProgress.MySQLRestoreBackup + (*JobProgress_Logs)(nil), // 85: agent.v1.JobProgress.Logs + (*GetVersionsRequest_MySQLd)(nil), // 86: agent.v1.GetVersionsRequest.MySQLd + (*GetVersionsRequest_Xtrabackup)(nil), // 87: agent.v1.GetVersionsRequest.Xtrabackup + (*GetVersionsRequest_Xbcloud)(nil), // 88: agent.v1.GetVersionsRequest.Xbcloud + (*GetVersionsRequest_Qpress)(nil), // 89: agent.v1.GetVersionsRequest.Qpress + (*GetVersionsRequest_MongoDB)(nil), // 90: agent.v1.GetVersionsRequest.MongoDB + (*GetVersionsRequest_PBM)(nil), // 91: agent.v1.GetVersionsRequest.PBM + (*GetVersionsRequest_Software)(nil), // 92: agent.v1.GetVersionsRequest.Software + (*GetVersionsResponse_Version)(nil), // 93: agent.v1.GetVersionsResponse.Version + (*timestamppb.Timestamp)(nil), // 94: google.protobuf.Timestamp + (*MetricsBucket)(nil), // 95: agent.v1.MetricsBucket + (v1.AgentStatus)(0), // 96: inventory.v1.AgentStatus + (*durationpb.Duration)(nil), // 97: google.protobuf.Duration + (v1.ServiceType)(0), // 98: inventory.v1.ServiceType + (*status.Status)(nil), // 99: google.rpc.Status + (v1.AgentType)(0), // 100: inventory.v1.AgentType + (*v1.RTAOptions)(nil), // 101: inventory.v1.RTAOptions + (v11.DataModel)(0), // 102: backup.v1.DataModel + (*v11.PbmMetadata)(nil), // 103: backup.v1.PbmMetadata + (*v11.Metadata)(nil), // 104: backup.v1.Metadata + } +) + var file_agent_v1_agent_proto_depIdxs = []int32{ 44, // 0: agent.v1.TextFiles.files:type_name -> agent.v1.TextFiles.FilesEntry 94, // 1: agent.v1.Pong.current_time:type_name -> google.protobuf.Timestamp diff --git a/api/agent/v1/agent.pb.validate.go b/api/agent/v1/agent.pb.validate.go index cfc2a1682b7..3cac3cc4faf 100644 --- a/api/agent/v1/agent.pb.validate.go +++ b/api/agent/v1/agent.pb.validate.go @@ -19,7 +19,6 @@ import ( "google.golang.org/protobuf/types/known/anypb" backupv1 "github.com/percona/pmm/api/backup/v1" - inventoryv1 "github.com/percona/pmm/api/inventory/v1" ) diff --git a/api/agent/v1/agent.swagger.json b/api/agent/v1/agent.swagger.json deleted file mode 100644 index 9be2eb39da2..00000000000 --- a/api/agent/v1/agent.swagger.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "agent/v1/agent.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "AgentService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - } - }, - "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client." - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - }, - "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." - } - }, - "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." - } - } -} diff --git a/api/agent/v1/agent_grpc.pb.go b/api/agent/v1/agent_grpc.pb.go index d307ddcad19..93727efa84c 100644 --- a/api/agent/v1/agent_grpc.pb.go +++ b/api/agent/v1/agent_grpc.pb.go @@ -8,6 +8,7 @@ package agentv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/agent/v1/collector.pb.go b/api/agent/v1/collector.pb.go index f1c9b64e7a9..4eaa7eb54a1 100644 --- a/api/agent/v1/collector.pb.go +++ b/api/agent/v1/collector.pb.go @@ -7,12 +7,14 @@ package agentv1 import ( - v1 "github.com/percona/pmm/api/inventory/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -2808,20 +2810,23 @@ func file_agent_v1_collector_proto_rawDescGZIP() []byte { return file_agent_v1_collector_proto_rawDescData } -var file_agent_v1_collector_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_agent_v1_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_agent_v1_collector_proto_goTypes = []any{ - (ExampleType)(0), // 0: agent.v1.ExampleType - (*MetricsBucket)(nil), // 1: agent.v1.MetricsBucket - (*HistogramItem)(nil), // 2: agent.v1.HistogramItem - (*MetricsBucket_Common)(nil), // 3: agent.v1.MetricsBucket.Common - (*MetricsBucket_MySQL)(nil), // 4: agent.v1.MetricsBucket.MySQL - (*MetricsBucket_MongoDB)(nil), // 5: agent.v1.MetricsBucket.MongoDB - (*MetricsBucket_PostgreSQL)(nil), // 6: agent.v1.MetricsBucket.PostgreSQL - nil, // 7: agent.v1.MetricsBucket.Common.CommentsEntry - nil, // 8: agent.v1.MetricsBucket.Common.ErrorsEntry - (v1.AgentType)(0), // 9: inventory.v1.AgentType -} +var ( + file_agent_v1_collector_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_agent_v1_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 8) + file_agent_v1_collector_proto_goTypes = []any{ + (ExampleType)(0), // 0: agent.v1.ExampleType + (*MetricsBucket)(nil), // 1: agent.v1.MetricsBucket + (*HistogramItem)(nil), // 2: agent.v1.HistogramItem + (*MetricsBucket_Common)(nil), // 3: agent.v1.MetricsBucket.Common + (*MetricsBucket_MySQL)(nil), // 4: agent.v1.MetricsBucket.MySQL + (*MetricsBucket_MongoDB)(nil), // 5: agent.v1.MetricsBucket.MongoDB + (*MetricsBucket_PostgreSQL)(nil), // 6: agent.v1.MetricsBucket.PostgreSQL + nil, // 7: agent.v1.MetricsBucket.Common.CommentsEntry + nil, // 8: agent.v1.MetricsBucket.Common.ErrorsEntry + (v1.AgentType)(0), // 9: inventory.v1.AgentType + } +) + var file_agent_v1_collector_proto_depIdxs = []int32{ 3, // 0: agent.v1.MetricsBucket.common:type_name -> agent.v1.MetricsBucket.Common 4, // 1: agent.v1.MetricsBucket.mysql:type_name -> agent.v1.MetricsBucket.MySQL diff --git a/api/agent/v1/collector.swagger.json b/api/agent/v1/collector.swagger.json deleted file mode 100644 index 461533c2478..00000000000 --- a/api/agent/v1/collector.swagger.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "agent/v1/collector.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - } - }, - "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client." - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - }, - "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." - } - }, - "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." - } - } -} diff --git a/api/agentlocal/v1/agentlocal.pb.go b/api/agentlocal/v1/agentlocal.pb.go index 374821c2931..a2836f3cd3c 100644 --- a/api/agentlocal/v1/agentlocal.pb.go +++ b/api/agentlocal/v1/agentlocal.pb.go @@ -7,14 +7,16 @@ package agentlocalv1 import ( - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" - reflect "reflect" - sync "sync" - unsafe "unsafe" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -242,7 +244,7 @@ func (x *StatusRequest) GetGetNetworkInfo() bool { type StatusResponse struct { state protoimpl.MessageState `protogen:"open.v1"` AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - RunsOnNodeId string `protobuf:"bytes,2,opt,name=runs_on_node_id,json=runsOnNodeId,proto3" json:"runs_on_node_id,omitempty"` //TODO: rename to node_id + RunsOnNodeId string `protobuf:"bytes,2,opt,name=runs_on_node_id,json=runsOnNodeId,proto3" json:"runs_on_node_id,omitempty"` // TODO: rename to node_id NodeName string `protobuf:"bytes,3,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` ServerInfo *ServerInfo `protobuf:"bytes,4,opt,name=server_info,json=serverInfo,proto3" json:"server_info,omitempty"` AgentsInfo []*AgentInfo `protobuf:"bytes,5,rep,name=agents_info,json=agentsInfo,proto3" json:"agents_info,omitempty"` @@ -469,18 +471,21 @@ func file_agentlocal_v1_agentlocal_proto_rawDescGZIP() []byte { return file_agentlocal_v1_agentlocal_proto_rawDescData } -var file_agentlocal_v1_agentlocal_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_agentlocal_v1_agentlocal_proto_goTypes = []any{ - (*ServerInfo)(nil), // 0: agentlocal.v1.ServerInfo - (*AgentInfo)(nil), // 1: agentlocal.v1.AgentInfo - (*StatusRequest)(nil), // 2: agentlocal.v1.StatusRequest - (*StatusResponse)(nil), // 3: agentlocal.v1.StatusResponse - (*ReloadRequest)(nil), // 4: agentlocal.v1.ReloadRequest - (*ReloadResponse)(nil), // 5: agentlocal.v1.ReloadResponse - (*durationpb.Duration)(nil), // 6: google.protobuf.Duration - (v1.AgentType)(0), // 7: inventory.v1.AgentType - (v1.AgentStatus)(0), // 8: inventory.v1.AgentStatus -} +var ( + file_agentlocal_v1_agentlocal_proto_msgTypes = make([]protoimpl.MessageInfo, 6) + file_agentlocal_v1_agentlocal_proto_goTypes = []any{ + (*ServerInfo)(nil), // 0: agentlocal.v1.ServerInfo + (*AgentInfo)(nil), // 1: agentlocal.v1.AgentInfo + (*StatusRequest)(nil), // 2: agentlocal.v1.StatusRequest + (*StatusResponse)(nil), // 3: agentlocal.v1.StatusResponse + (*ReloadRequest)(nil), // 4: agentlocal.v1.ReloadRequest + (*ReloadResponse)(nil), // 5: agentlocal.v1.ReloadResponse + (*durationpb.Duration)(nil), // 6: google.protobuf.Duration + (v1.AgentType)(0), // 7: inventory.v1.AgentType + (v1.AgentStatus)(0), // 8: inventory.v1.AgentStatus + } +) + var file_agentlocal_v1_agentlocal_proto_depIdxs = []int32{ 6, // 0: agentlocal.v1.ServerInfo.latency:type_name -> google.protobuf.Duration 6, // 1: agentlocal.v1.ServerInfo.clock_drift:type_name -> google.protobuf.Duration diff --git a/api/agentlocal/v1/agentlocal.swagger.json b/api/agentlocal/v1/agentlocal.swagger.json deleted file mode 100644 index 4f22ad35a7c..00000000000 --- a/api/agentlocal/v1/agentlocal.swagger.json +++ /dev/null @@ -1,295 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "agentlocal/v1/agentlocal.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "AgentLocalService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/local/Reload": { - "post": { - "summary": "Reload reloads pmm-agent configuration.", - "operationId": "Reload", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ReloadResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1ReloadRequest" - } - } - ], - "tags": [ - "AgentLocalService" - ] - } - }, - "/local/Status": { - "get": { - "summary": "Status returns current pmm-agent status.", - "operationId": "Status2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1StatusResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "get_network_info", - "description": "Returns network info (latency and clock_drift) if true.", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "tags": [ - "AgentLocalService" - ] - }, - "post": { - "summary": "Status returns current pmm-agent status.", - "operationId": "Status", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1StatusResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1StatusRequest" - } - } - ], - "tags": [ - "AgentLocalService" - ] - } - } - }, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "v1AgentInfo": { - "type": "object", - "properties": { - "agent_id": { - "type": "string" - }, - "agent_type": { - "$ref": "#/definitions/v1AgentType" - }, - "status": { - "$ref": "#/definitions/v1AgentStatus" - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "The current listen port of this Agent (exporter or vmagent).\nZero for other Agent types, or if unknown or not yet supported." - }, - "process_exec_path": { - "type": "string" - } - }, - "description": "AgentInfo contains information about Agent managed by pmm-agent." - }, - "v1AgentStatus": { - "type": "string", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "default": "AGENT_STATUS_UNSPECIFIED", - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state." - }, - "v1AgentType": { - "type": "string", - "enum": [ - "AGENT_TYPE_UNSPECIFIED", - "AGENT_TYPE_PMM_AGENT", - "AGENT_TYPE_VM_AGENT", - "AGENT_TYPE_NODE_EXPORTER", - "AGENT_TYPE_MYSQLD_EXPORTER", - "AGENT_TYPE_MONGODB_EXPORTER", - "AGENT_TYPE_POSTGRES_EXPORTER", - "AGENT_TYPE_PROXYSQL_EXPORTER", - "AGENT_TYPE_VALKEY_EXPORTER", - "AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT", - "AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT", - "AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT", - "AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT", - "AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT", - "AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT", - "AGENT_TYPE_EXTERNAL_EXPORTER", - "AGENT_TYPE_RDS_EXPORTER", - "AGENT_TYPE_AZURE_DATABASE_EXPORTER", - "AGENT_TYPE_NOMAD_AGENT", - "AGENT_TYPE_RTA_MONGODB_AGENT" - ], - "default": "AGENT_TYPE_UNSPECIFIED", - "description": "AgentType describes supported Agent types." - }, - "v1ReloadRequest": { - "type": "object" - }, - "v1ReloadResponse": { - "type": "object", - "description": "ReloadRequest may not be received by the client due to pmm-agent restart." - }, - "v1ServerInfo": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "PMM Server URL in a form https://HOST:PORT/." - }, - "insecure_tls": { - "type": "boolean", - "description": "PMM Server's TLS certificate validation should be skipped if true." - }, - "connected": { - "type": "boolean", - "description": "True if pmm-agent is currently connected to the server." - }, - "version": { - "type": "string", - "description": "PMM Server version (if agent is connected)." - }, - "latency": { - "type": "string", - "description": "Ping time from pmm-agent to pmm-managed (if agent is connected)." - }, - "clock_drift": { - "type": "string", - "description": "Clock drift from PMM Server (if agent is connected)." - } - }, - "description": "ServerInfo contains information about the PMM Server." - }, - "v1StatusRequest": { - "type": "object", - "properties": { - "get_network_info": { - "type": "boolean", - "description": "Returns network info (latency and clock_drift) if true." - } - } - }, - "v1StatusResponse": { - "type": "object", - "properties": { - "agent_id": { - "type": "string" - }, - "runs_on_node_id": { - "type": "string", - "title": "TODO: rename to node_id" - }, - "node_name": { - "type": "string" - }, - "server_info": { - "$ref": "#/definitions/v1ServerInfo" - }, - "agents_info": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1AgentInfo" - } - }, - "config_filepath": { - "type": "string", - "description": "Config file path if pmm-agent was started with one." - }, - "agent_version": { - "type": "string", - "description": "PMM Agent version." - }, - "connection_uptime": { - "type": "number", - "format": "float", - "title": "Shows connection uptime in percentage between agent and server" - } - } - } - } -} diff --git a/api/agentlocal/v1/agentlocal_grpc.pb.go b/api/agentlocal/v1/agentlocal_grpc.pb.go index 1b4e4c73073..14d47f7c727 100644 --- a/api/agentlocal/v1/agentlocal_grpc.pb.go +++ b/api/agentlocal/v1/agentlocal_grpc.pb.go @@ -8,6 +8,7 @@ package agentlocalv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -86,6 +87,7 @@ type UnimplementedAgentLocalServiceServer struct{} func (UnimplementedAgentLocalServiceServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { return nil, status.Error(codes.Unimplemented, "method Status not implemented") } + func (UnimplementedAgentLocalServiceServer) Reload(context.Context, *ReloadRequest) (*ReloadResponse, error) { return nil, status.Error(codes.Unimplemented, "method Reload not implemented") } diff --git a/api/alerting/v1/alerting.pb.go b/api/alerting/v1/alerting.pb.go index 44c388389a1..acd727a9865 100644 --- a/api/alerting/v1/alerting.pb.go +++ b/api/alerting/v1/alerting.pb.go @@ -7,16 +7,18 @@ package alertingv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" - v1 "github.com/percona/pmm/api/management/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" + + v1 "github.com/percona/pmm/api/management/v1" ) const ( @@ -1424,37 +1426,40 @@ func file_alerting_v1_alerting_proto_rawDescGZIP() []byte { return file_alerting_v1_alerting_proto_rawDescData } -var file_alerting_v1_alerting_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_alerting_v1_alerting_proto_msgTypes = make([]protoimpl.MessageInfo, 20) -var file_alerting_v1_alerting_proto_goTypes = []any{ - (TemplateSource)(0), // 0: alerting.v1.TemplateSource - (FilterType)(0), // 1: alerting.v1.FilterType - (*BoolParamDefinition)(nil), // 2: alerting.v1.BoolParamDefinition - (*FloatParamDefinition)(nil), // 3: alerting.v1.FloatParamDefinition - (*StringParamDefinition)(nil), // 4: alerting.v1.StringParamDefinition - (*ParamDefinition)(nil), // 5: alerting.v1.ParamDefinition - (*Template)(nil), // 6: alerting.v1.Template - (*ListTemplatesRequest)(nil), // 7: alerting.v1.ListTemplatesRequest - (*ListTemplatesResponse)(nil), // 8: alerting.v1.ListTemplatesResponse - (*CreateTemplateRequest)(nil), // 9: alerting.v1.CreateTemplateRequest - (*CreateTemplateResponse)(nil), // 10: alerting.v1.CreateTemplateResponse - (*UpdateTemplateRequest)(nil), // 11: alerting.v1.UpdateTemplateRequest - (*UpdateTemplateResponse)(nil), // 12: alerting.v1.UpdateTemplateResponse - (*DeleteTemplateRequest)(nil), // 13: alerting.v1.DeleteTemplateRequest - (*DeleteTemplateResponse)(nil), // 14: alerting.v1.DeleteTemplateResponse - (*Filter)(nil), // 15: alerting.v1.Filter - (*ParamValue)(nil), // 16: alerting.v1.ParamValue - (*CreateRuleRequest)(nil), // 17: alerting.v1.CreateRuleRequest - (*CreateRuleResponse)(nil), // 18: alerting.v1.CreateRuleResponse - nil, // 19: alerting.v1.Template.LabelsEntry - nil, // 20: alerting.v1.Template.AnnotationsEntry - nil, // 21: alerting.v1.CreateRuleRequest.CustomLabelsEntry - (ParamUnit)(0), // 22: alerting.v1.ParamUnit - (ParamType)(0), // 23: alerting.v1.ParamType - (*durationpb.Duration)(nil), // 24: google.protobuf.Duration - (v1.Severity)(0), // 25: management.v1.Severity - (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp -} +var ( + file_alerting_v1_alerting_proto_enumTypes = make([]protoimpl.EnumInfo, 2) + file_alerting_v1_alerting_proto_msgTypes = make([]protoimpl.MessageInfo, 20) + file_alerting_v1_alerting_proto_goTypes = []any{ + (TemplateSource)(0), // 0: alerting.v1.TemplateSource + (FilterType)(0), // 1: alerting.v1.FilterType + (*BoolParamDefinition)(nil), // 2: alerting.v1.BoolParamDefinition + (*FloatParamDefinition)(nil), // 3: alerting.v1.FloatParamDefinition + (*StringParamDefinition)(nil), // 4: alerting.v1.StringParamDefinition + (*ParamDefinition)(nil), // 5: alerting.v1.ParamDefinition + (*Template)(nil), // 6: alerting.v1.Template + (*ListTemplatesRequest)(nil), // 7: alerting.v1.ListTemplatesRequest + (*ListTemplatesResponse)(nil), // 8: alerting.v1.ListTemplatesResponse + (*CreateTemplateRequest)(nil), // 9: alerting.v1.CreateTemplateRequest + (*CreateTemplateResponse)(nil), // 10: alerting.v1.CreateTemplateResponse + (*UpdateTemplateRequest)(nil), // 11: alerting.v1.UpdateTemplateRequest + (*UpdateTemplateResponse)(nil), // 12: alerting.v1.UpdateTemplateResponse + (*DeleteTemplateRequest)(nil), // 13: alerting.v1.DeleteTemplateRequest + (*DeleteTemplateResponse)(nil), // 14: alerting.v1.DeleteTemplateResponse + (*Filter)(nil), // 15: alerting.v1.Filter + (*ParamValue)(nil), // 16: alerting.v1.ParamValue + (*CreateRuleRequest)(nil), // 17: alerting.v1.CreateRuleRequest + (*CreateRuleResponse)(nil), // 18: alerting.v1.CreateRuleResponse + nil, // 19: alerting.v1.Template.LabelsEntry + nil, // 20: alerting.v1.Template.AnnotationsEntry + nil, // 21: alerting.v1.CreateRuleRequest.CustomLabelsEntry + (ParamUnit)(0), // 22: alerting.v1.ParamUnit + (ParamType)(0), // 23: alerting.v1.ParamType + (*durationpb.Duration)(nil), // 24: google.protobuf.Duration + (v1.Severity)(0), // 25: management.v1.Severity + (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp + } +) + var file_alerting_v1_alerting_proto_depIdxs = []int32{ 22, // 0: alerting.v1.ParamDefinition.unit:type_name -> alerting.v1.ParamUnit 23, // 1: alerting.v1.ParamDefinition.type:type_name -> alerting.v1.ParamType diff --git a/api/alerting/v1/alerting.pb.validate.go b/api/alerting/v1/alerting.pb.validate.go index bc3dfba5dfa..f6a7dbcf1fa 100644 --- a/api/alerting/v1/alerting.pb.validate.go +++ b/api/alerting/v1/alerting.pb.validate.go @@ -851,7 +851,6 @@ func (m *ListTemplatesRequest) validate(all bool) error { // no validation rules for Reload if m.PageSize != nil { - if m.GetPageSize() < 1 { err := ListTemplatesRequestValidationError{ field: "PageSize", @@ -862,11 +861,9 @@ func (m *ListTemplatesRequest) validate(all bool) error { } errors = append(errors, err) } - } if m.PageIndex != nil { - if m.GetPageIndex() < 0 { err := ListTemplatesRequestValidationError{ field: "PageIndex", @@ -877,7 +874,6 @@ func (m *ListTemplatesRequest) validate(all bool) error { } errors = append(errors, err) } - } if len(errors) > 0 { diff --git a/api/alerting/v1/alerting.swagger.json b/api/alerting/v1/alerting.swagger.json deleted file mode 100644 index 726625709d5..00000000000 --- a/api/alerting/v1/alerting.swagger.json +++ /dev/null @@ -1,581 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "alerting/v1/alerting.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "AlertingService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/alerting/rules": { - "post": { - "summary": "CreateRule creates alerting rule from the given template.", - "operationId": "CreateRule", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1CreateRuleResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1CreateRuleRequest" - } - } - ], - "tags": [ - "AlertingService" - ] - } - }, - "/v1/alerting/templates": { - "get": { - "summary": "ListTemplates returns a list of all collected alert rule templates.", - "operationId": "ListTemplates", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListTemplatesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "page_size", - "description": "Maximum number of results per page.", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "page_index", - "description": "Index of the requested page, starts from 0.", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "reload", - "description": "If true, template files will be re-read from disk.", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "tags": [ - "AlertingService" - ] - }, - "post": { - "summary": "CreateTemplate creates a new template.", - "operationId": "CreateTemplate", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1CreateTemplateResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1CreateTemplateRequest" - } - } - ], - "tags": [ - "AlertingService" - ] - } - }, - "/v1/alerting/templates/{name}": { - "delete": { - "summary": "DeleteTemplate deletes existing, previously created via API.", - "operationId": "DeleteTemplate", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1DeleteTemplateResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "name", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "AlertingService" - ] - }, - "put": { - "summary": "UpdateTemplate updates existing template, previously created via API.", - "operationId": "UpdateTemplate", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UpdateTemplateResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "name", - "description": "Machine-readable name (ID).", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AlertingServiceUpdateTemplateBody" - } - } - ], - "tags": [ - "AlertingService" - ] - } - } - }, - "definitions": { - "AlertingServiceUpdateTemplateBody": { - "type": "object", - "properties": { - "yaml": { - "type": "string", - "description": "YAML template file content." - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1BoolParamDefinition": { - "type": "object", - "properties": { - "default": { - "type": "boolean", - "x-nullable": true - } - }, - "description": "BoolParamDefinition represents boolean parameter's default value." - }, - "v1CreateRuleRequest": { - "type": "object", - "properties": { - "template_name": { - "type": "string", - "description": "Template name." - }, - "name": { - "type": "string", - "description": "Rule name." - }, - "group": { - "type": "string", - "description": "Rule group name." - }, - "folder_uid": { - "type": "string", - "description": "Folder UID." - }, - "params": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1ParamValue" - }, - "description": "Rule parameters. All template parameters should be set." - }, - "for": { - "type": "string", - "description": "Rule duration. Should be set." - }, - "severity": { - "$ref": "#/definitions/v1Severity", - "description": "Rule severity. Should be set." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "All custom labels to add or remove (with empty values) to default labels from template." - }, - "filters": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Filter" - }, - "description": "Filters." - }, - "interval": { - "type": "string", - "title": "Evaluation Interval" - } - } - }, - "v1CreateRuleResponse": { - "type": "object" - }, - "v1CreateTemplateRequest": { - "type": "object", - "properties": { - "yaml": { - "type": "string", - "description": "YAML template file content." - } - } - }, - "v1CreateTemplateResponse": { - "type": "object" - }, - "v1DeleteTemplateResponse": { - "type": "object" - }, - "v1Filter": { - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/v1FilterType" - }, - "label": { - "type": "string" - }, - "regexp": { - "type": "string" - } - }, - "description": "Filter represents a single filter condition." - }, - "v1FilterType": { - "type": "string", - "enum": [ - "FILTER_TYPE_UNSPECIFIED", - "FILTER_TYPE_MATCH", - "FILTER_TYPE_MISMATCH" - ], - "default": "FILTER_TYPE_UNSPECIFIED", - "description": "FilterType represents filter matching type." - }, - "v1FloatParamDefinition": { - "type": "object", - "properties": { - "default": { - "type": "number", - "format": "double", - "x-nullable": true, - "description": "Default value." - }, - "min": { - "type": "number", - "format": "double", - "x-nullable": true, - "description": "Minimum valid value (inclusive)." - }, - "max": { - "type": "number", - "format": "double", - "x-nullable": true, - "description": "Maximum valid value (inclusive)." - } - }, - "description": "FloatParamDefinition represents float parameter's default value and valid range." - }, - "v1ListTemplatesResponse": { - "type": "object", - "properties": { - "total_items": { - "type": "integer", - "format": "int32", - "description": "Total number of results." - }, - "total_pages": { - "type": "integer", - "format": "int32", - "description": "Total number of pages." - }, - "templates": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Template" - }, - "description": "Alerting templates." - } - } - }, - "v1ParamDefinition": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Machine-readable name (ID) that is used in expression." - }, - "summary": { - "type": "string", - "description": "Short human-readable parameter summary." - }, - "unit": { - "$ref": "#/definitions/v1ParamUnit", - "description": "Parameter unit. TODO: remove this parameter." - }, - "type": { - "$ref": "#/definitions/v1ParamType", - "description": "Parameter type." - }, - "bool": { - "$ref": "#/definitions/v1BoolParamDefinition", - "description": "Bool value." - }, - "float": { - "$ref": "#/definitions/v1FloatParamDefinition", - "description": "Float value." - }, - "string": { - "$ref": "#/definitions/v1StringParamDefinition", - "description": "String value." - } - }, - "description": "ParamDefinition represents a single query parameter." - }, - "v1ParamType": { - "type": "string", - "enum": [ - "PARAM_TYPE_UNSPECIFIED", - "PARAM_TYPE_BOOL", - "PARAM_TYPE_FLOAT", - "PARAM_TYPE_STRING" - ], - "default": "PARAM_TYPE_UNSPECIFIED", - "description": "ParamType represents template parameter type." - }, - "v1ParamUnit": { - "type": "string", - "enum": [ - "PARAM_UNIT_UNSPECIFIED", - "PARAM_UNIT_PERCENTAGE", - "PARAM_UNIT_SECONDS" - ], - "default": "PARAM_UNIT_UNSPECIFIED", - "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_UNSPECIFIED: Invalid, unknown or absent.\n - PARAM_UNIT_PERCENTAGE: %\n - PARAM_UNIT_SECONDS: s" - }, - "v1ParamValue": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Machine-readable name (ID) that is used in expression." - }, - "type": { - "$ref": "#/definitions/v1ParamType", - "description": "Parameter type." - }, - "bool": { - "type": "boolean", - "description": "Bool value." - }, - "float": { - "type": "number", - "format": "double", - "description": "Float value." - }, - "string": { - "type": "string", - "description": "String value." - } - }, - "description": "ParamValue represents a single rule parameter value." - }, - "v1Severity": { - "type": "string", - "enum": [ - "SEVERITY_UNSPECIFIED", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "default": "SEVERITY_UNSPECIFIED", - "description": "Severity represents severity level of the check result or alert." - }, - "v1StringParamDefinition": { - "type": "object", - "properties": { - "default": { - "type": "string", - "x-nullable": true, - "description": "Default value." - } - }, - "description": "StringParamDefinition represents string parameter's default value." - }, - "v1Template": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Machine-readable name (ID)." - }, - "summary": { - "type": "string", - "description": "Short human-readable summary." - }, - "expr": { - "type": "string", - "description": "PromQL query expression with templating parameters." - }, - "params": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1ParamDefinition" - }, - "description": "Query parameters definitions." - }, - "for": { - "type": "string", - "description": "Default duration value." - }, - "severity": { - "$ref": "#/definitions/v1Severity", - "description": "Severity." - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Labels." - }, - "annotations": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Annotations." - }, - "source": { - "$ref": "#/definitions/v1TemplateSource", - "description": "Template source. Only templates created via API can be updated or deleted via API." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Template creation time. Empty for built-in and SaaS templates." - }, - "yaml": { - "type": "string", - "description": "YAML template file content. Empty for built-in and SaaS templates." - } - }, - "description": "Template represents Alert Template that is used to create Alert Rule." - }, - "v1TemplateSource": { - "type": "string", - "enum": [ - "TEMPLATE_SOURCE_UNSPECIFIED", - "TEMPLATE_SOURCE_BUILT_IN", - "TEMPLATE_SOURCE_SAAS", - "TEMPLATE_SOURCE_USER_FILE", - "TEMPLATE_SOURCE_USER_API" - ], - "default": "TEMPLATE_SOURCE_UNSPECIFIED", - "description": "TemplateSource defines template source.\n\n - TEMPLATE_SOURCE_BUILT_IN: Template that is shipped with PMM Server releases.\n - TEMPLATE_SOURCE_SAAS: Template that is downloaded from check.percona.com.\n - TEMPLATE_SOURCE_USER_FILE: Templated loaded from user-suplied file.\n - TEMPLATE_SOURCE_USER_API: Templated created via API." - }, - "v1UpdateTemplateResponse": { - "type": "object" - } - } -} diff --git a/api/alerting/v1/alerting_grpc.pb.go b/api/alerting/v1/alerting_grpc.pb.go index 1db7fdf68b9..d559dc19bfe 100644 --- a/api/alerting/v1/alerting_grpc.pb.go +++ b/api/alerting/v1/alerting_grpc.pb.go @@ -8,6 +8,7 @@ package alertingv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -131,15 +132,19 @@ type UnimplementedAlertingServiceServer struct{} func (UnimplementedAlertingServiceServer) ListTemplates(context.Context, *ListTemplatesRequest) (*ListTemplatesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListTemplates not implemented") } + func (UnimplementedAlertingServiceServer) CreateTemplate(context.Context, *CreateTemplateRequest) (*CreateTemplateResponse, error) { return nil, status.Error(codes.Unimplemented, "method CreateTemplate not implemented") } + func (UnimplementedAlertingServiceServer) UpdateTemplate(context.Context, *UpdateTemplateRequest) (*UpdateTemplateResponse, error) { return nil, status.Error(codes.Unimplemented, "method UpdateTemplate not implemented") } + func (UnimplementedAlertingServiceServer) DeleteTemplate(context.Context, *DeleteTemplateRequest) (*DeleteTemplateResponse, error) { return nil, status.Error(codes.Unimplemented, "method DeleteTemplate not implemented") } + func (UnimplementedAlertingServiceServer) CreateRule(context.Context, *CreateRuleRequest) (*CreateRuleResponse, error) { return nil, status.Error(codes.Unimplemented, "method CreateRule not implemented") } diff --git a/api/alerting/v1/params.pb.go b/api/alerting/v1/params.pb.go index 4f9034616f4..5df5a859b29 100644 --- a/api/alerting/v1/params.pb.go +++ b/api/alerting/v1/params.pb.go @@ -7,11 +7,12 @@ package alertingv1 import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -155,11 +156,14 @@ func file_alerting_v1_params_proto_rawDescGZIP() []byte { return file_alerting_v1_params_proto_rawDescData } -var file_alerting_v1_params_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_alerting_v1_params_proto_goTypes = []any{ - (ParamUnit)(0), // 0: alerting.v1.ParamUnit - (ParamType)(0), // 1: alerting.v1.ParamType -} +var ( + file_alerting_v1_params_proto_enumTypes = make([]protoimpl.EnumInfo, 2) + file_alerting_v1_params_proto_goTypes = []any{ + (ParamUnit)(0), // 0: alerting.v1.ParamUnit + (ParamType)(0), // 1: alerting.v1.ParamType + } +) + var file_alerting_v1_params_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/alerting/v1/params.swagger.json b/api/alerting/v1/params.swagger.json deleted file mode 100644 index d56f9a7c05a..00000000000 --- a/api/alerting/v1/params.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "alerting/v1/params.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/backup/v1/artifacts.pb.go b/api/backup/v1/artifacts.pb.go index a921d234e96..5302152bd21 100644 --- a/api/backup/v1/artifacts.pb.go +++ b/api/backup/v1/artifacts.pb.go @@ -7,13 +7,14 @@ package backupv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" ) const ( @@ -636,23 +637,26 @@ func file_backup_v1_artifacts_proto_rawDescGZIP() []byte { return file_backup_v1_artifacts_proto_rawDescData } -var file_backup_v1_artifacts_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_backup_v1_artifacts_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_backup_v1_artifacts_proto_goTypes = []any{ - (BackupStatus)(0), // 0: backup.v1.BackupStatus - (*Artifact)(nil), // 1: backup.v1.Artifact - (*ListArtifactsRequest)(nil), // 2: backup.v1.ListArtifactsRequest - (*ListArtifactsResponse)(nil), // 3: backup.v1.ListArtifactsResponse - (*DeleteArtifactRequest)(nil), // 4: backup.v1.DeleteArtifactRequest - (*DeleteArtifactResponse)(nil), // 5: backup.v1.DeleteArtifactResponse - (*PitrTimerange)(nil), // 6: backup.v1.PitrTimerange - (*ListPitrTimerangesRequest)(nil), // 7: backup.v1.ListPitrTimerangesRequest - (*ListPitrTimerangesResponse)(nil), // 8: backup.v1.ListPitrTimerangesResponse - (DataModel)(0), // 9: backup.v1.DataModel - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp - (BackupMode)(0), // 11: backup.v1.BackupMode - (*Metadata)(nil), // 12: backup.v1.Metadata -} +var ( + file_backup_v1_artifacts_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_backup_v1_artifacts_proto_msgTypes = make([]protoimpl.MessageInfo, 8) + file_backup_v1_artifacts_proto_goTypes = []any{ + (BackupStatus)(0), // 0: backup.v1.BackupStatus + (*Artifact)(nil), // 1: backup.v1.Artifact + (*ListArtifactsRequest)(nil), // 2: backup.v1.ListArtifactsRequest + (*ListArtifactsResponse)(nil), // 3: backup.v1.ListArtifactsResponse + (*DeleteArtifactRequest)(nil), // 4: backup.v1.DeleteArtifactRequest + (*DeleteArtifactResponse)(nil), // 5: backup.v1.DeleteArtifactResponse + (*PitrTimerange)(nil), // 6: backup.v1.PitrTimerange + (*ListPitrTimerangesRequest)(nil), // 7: backup.v1.ListPitrTimerangesRequest + (*ListPitrTimerangesResponse)(nil), // 8: backup.v1.ListPitrTimerangesResponse + (DataModel)(0), // 9: backup.v1.DataModel + (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp + (BackupMode)(0), // 11: backup.v1.BackupMode + (*Metadata)(nil), // 12: backup.v1.Metadata + } +) + var file_backup_v1_artifacts_proto_depIdxs = []int32{ 9, // 0: backup.v1.Artifact.data_model:type_name -> backup.v1.DataModel 0, // 1: backup.v1.Artifact.status:type_name -> backup.v1.BackupStatus diff --git a/api/backup/v1/artifacts.swagger.json b/api/backup/v1/artifacts.swagger.json deleted file mode 100644 index c160f10d3e5..00000000000 --- a/api/backup/v1/artifacts.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "backup/v1/artifacts.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/backup/v1/backup.pb.go b/api/backup/v1/backup.pb.go index f358db0246e..36a2ec0efb4 100644 --- a/api/backup/v1/backup.pb.go +++ b/api/backup/v1/backup.pb.go @@ -7,17 +7,19 @@ package backupv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - v1 "github.com/percona/pmm/api/inventory/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -1241,37 +1243,40 @@ func file_backup_v1_backup_proto_rawDescGZIP() []byte { return file_backup_v1_backup_proto_rawDescData } -var file_backup_v1_backup_proto_msgTypes = make([]protoimpl.MessageInfo, 15) -var file_backup_v1_backup_proto_goTypes = []any{ - (*StartBackupRequest)(nil), // 0: backup.v1.StartBackupRequest - (*StartBackupResponse)(nil), // 1: backup.v1.StartBackupResponse - (*ListArtifactCompatibleServicesRequest)(nil), // 2: backup.v1.ListArtifactCompatibleServicesRequest - (*ListArtifactCompatibleServicesResponse)(nil), // 3: backup.v1.ListArtifactCompatibleServicesResponse - (*ScheduledBackup)(nil), // 4: backup.v1.ScheduledBackup - (*ScheduleBackupRequest)(nil), // 5: backup.v1.ScheduleBackupRequest - (*ScheduleBackupResponse)(nil), // 6: backup.v1.ScheduleBackupResponse - (*ListScheduledBackupsRequest)(nil), // 7: backup.v1.ListScheduledBackupsRequest - (*ListScheduledBackupsResponse)(nil), // 8: backup.v1.ListScheduledBackupsResponse - (*ChangeScheduledBackupRequest)(nil), // 9: backup.v1.ChangeScheduledBackupRequest - (*ChangeScheduledBackupResponse)(nil), // 10: backup.v1.ChangeScheduledBackupResponse - (*RemoveScheduledBackupRequest)(nil), // 11: backup.v1.RemoveScheduledBackupRequest - (*RemoveScheduledBackupResponse)(nil), // 12: backup.v1.RemoveScheduledBackupResponse - (*GetLogsRequest)(nil), // 13: backup.v1.GetLogsRequest - (*GetLogsResponse)(nil), // 14: backup.v1.GetLogsResponse - (*durationpb.Duration)(nil), // 15: google.protobuf.Duration - (DataModel)(0), // 16: backup.v1.DataModel - (*v1.MySQLService)(nil), // 17: inventory.v1.MySQLService - (*v1.MongoDBService)(nil), // 18: inventory.v1.MongoDBService - (*timestamppb.Timestamp)(nil), // 19: google.protobuf.Timestamp - (BackupMode)(0), // 20: backup.v1.BackupMode - (*LogChunk)(nil), // 21: backup.v1.LogChunk - (*ListArtifactsRequest)(nil), // 22: backup.v1.ListArtifactsRequest - (*DeleteArtifactRequest)(nil), // 23: backup.v1.DeleteArtifactRequest - (*ListPitrTimerangesRequest)(nil), // 24: backup.v1.ListPitrTimerangesRequest - (*ListArtifactsResponse)(nil), // 25: backup.v1.ListArtifactsResponse - (*DeleteArtifactResponse)(nil), // 26: backup.v1.DeleteArtifactResponse - (*ListPitrTimerangesResponse)(nil), // 27: backup.v1.ListPitrTimerangesResponse -} +var ( + file_backup_v1_backup_proto_msgTypes = make([]protoimpl.MessageInfo, 15) + file_backup_v1_backup_proto_goTypes = []any{ + (*StartBackupRequest)(nil), // 0: backup.v1.StartBackupRequest + (*StartBackupResponse)(nil), // 1: backup.v1.StartBackupResponse + (*ListArtifactCompatibleServicesRequest)(nil), // 2: backup.v1.ListArtifactCompatibleServicesRequest + (*ListArtifactCompatibleServicesResponse)(nil), // 3: backup.v1.ListArtifactCompatibleServicesResponse + (*ScheduledBackup)(nil), // 4: backup.v1.ScheduledBackup + (*ScheduleBackupRequest)(nil), // 5: backup.v1.ScheduleBackupRequest + (*ScheduleBackupResponse)(nil), // 6: backup.v1.ScheduleBackupResponse + (*ListScheduledBackupsRequest)(nil), // 7: backup.v1.ListScheduledBackupsRequest + (*ListScheduledBackupsResponse)(nil), // 8: backup.v1.ListScheduledBackupsResponse + (*ChangeScheduledBackupRequest)(nil), // 9: backup.v1.ChangeScheduledBackupRequest + (*ChangeScheduledBackupResponse)(nil), // 10: backup.v1.ChangeScheduledBackupResponse + (*RemoveScheduledBackupRequest)(nil), // 11: backup.v1.RemoveScheduledBackupRequest + (*RemoveScheduledBackupResponse)(nil), // 12: backup.v1.RemoveScheduledBackupResponse + (*GetLogsRequest)(nil), // 13: backup.v1.GetLogsRequest + (*GetLogsResponse)(nil), // 14: backup.v1.GetLogsResponse + (*durationpb.Duration)(nil), // 15: google.protobuf.Duration + (DataModel)(0), // 16: backup.v1.DataModel + (*v1.MySQLService)(nil), // 17: inventory.v1.MySQLService + (*v1.MongoDBService)(nil), // 18: inventory.v1.MongoDBService + (*timestamppb.Timestamp)(nil), // 19: google.protobuf.Timestamp + (BackupMode)(0), // 20: backup.v1.BackupMode + (*LogChunk)(nil), // 21: backup.v1.LogChunk + (*ListArtifactsRequest)(nil), // 22: backup.v1.ListArtifactsRequest + (*DeleteArtifactRequest)(nil), // 23: backup.v1.DeleteArtifactRequest + (*ListPitrTimerangesRequest)(nil), // 24: backup.v1.ListPitrTimerangesRequest + (*ListArtifactsResponse)(nil), // 25: backup.v1.ListArtifactsResponse + (*DeleteArtifactResponse)(nil), // 26: backup.v1.DeleteArtifactResponse + (*ListPitrTimerangesResponse)(nil), // 27: backup.v1.ListPitrTimerangesResponse + } +) + var file_backup_v1_backup_proto_depIdxs = []int32{ 15, // 0: backup.v1.StartBackupRequest.retry_interval:type_name -> google.protobuf.Duration 16, // 1: backup.v1.StartBackupRequest.data_model:type_name -> backup.v1.DataModel diff --git a/api/backup/v1/backup.swagger.json b/api/backup/v1/backup.swagger.json deleted file mode 100644 index 084b996bce7..00000000000 --- a/api/backup/v1/backup.swagger.json +++ /dev/null @@ -1,1003 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "backup/v1/backup.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "BackupService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/backups/artifacts": { - "get": { - "summary": "List artifacts", - "description": "Return a list of backup artifacts.", - "operationId": "ListArtifacts", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListArtifactsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "BackupService" - ] - } - }, - "/v1/backups/artifacts/{artifact_id}": { - "delete": { - "summary": "Delete Artifact", - "description": "Deletes an artifact.", - "operationId": "DeleteArtifact", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1DeleteArtifactResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "artifact_id", - "description": "Machine-readable artifact ID.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "remove_files", - "description": "Removes all the backup files associated with artifact if flag is set.", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "tags": [ - "BackupService" - ] - } - }, - "/v1/backups/artifacts/{artifact_id}/pitr-timeranges": { - "get": { - "summary": "List PITR Timeranges", - "description": "Return a list of available MongoDB point-in-time-recovery timeranges.", - "operationId": "ListPitrTimeranges", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListPitrTimerangesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "artifact_id", - "description": "Artifact ID represents artifact whose location has PITR timeranges to be retrieved.", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "BackupService" - ] - } - }, - "/v1/backups/scheduled": { - "get": { - "summary": "List Scheduled Backups", - "description": "List all scheduled backups.", - "operationId": "ListScheduledBackups", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListScheduledBackupsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "BackupService" - ] - } - }, - "/v1/backups/{artifact_id}/compatible-services": { - "get": { - "summary": "List Compatible Services", - "description": "List services that are compatible with the backup artifact.", - "operationId": "ListArtifactCompatibleServices", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListArtifactCompatibleServicesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "artifact_id", - "description": "Artifact id used to determine restore compatibility.", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "BackupService" - ] - } - }, - "/v1/backups/{artifact_id}/logs": { - "get": { - "summary": "Get Logs", - "description": "Get logs from the underlying tools for a backup/restore job.", - "operationId": "GetLogs", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetLogsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "artifact_id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "tags": [ - "BackupService" - ] - } - }, - "/v1/backups/{scheduled_backup_id}": { - "delete": { - "summary": "Remove a Scheduled Backup", - "description": "Remove a scheduled backup.", - "operationId": "RemoveScheduledBackup", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1RemoveScheduledBackupResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "scheduled_backup_id", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "BackupService" - ] - } - }, - "/v1/backups:changeScheduled": { - "put": { - "summary": "Change a Scheduled Backup", - "description": "Change a scheduled backup.", - "operationId": "ChangeScheduledBackup", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ChangeScheduledBackupResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1ChangeScheduledBackupRequest" - } - } - ], - "tags": [ - "BackupService" - ] - } - }, - "/v1/backups:schedule": { - "post": { - "summary": "Schedule a Backup", - "description": "Schedule a backup to run at a specified time.", - "operationId": "ScheduleBackup", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ScheduleBackupResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1ScheduleBackupRequest" - } - } - ], - "tags": [ - "BackupService" - ] - } - }, - "/v1/backups:start": { - "post": { - "summary": "Start a Backup", - "description": "Could return the Error message in the details containing specific ErrorCode indicating failure reason:\nERROR_CODE_XTRABACKUP_NOT_INSTALLED - xtrabackup is not installed on the service\nERROR_CODE_INVALID_XTRABACKUP - different versions of xtrabackup and xbcloud\nERROR_CODE_INCOMPATIBLE_XTRABACKUP - xtrabackup is not compatible with MySQL for taking a backup", - "operationId": "StartBackup", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1StartBackupResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1StartBackupRequest" - } - } - ], - "tags": [ - "BackupService" - ] - } - } - }, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1Artifact": { - "type": "object", - "properties": { - "artifact_id": { - "type": "string", - "description": "Machine-readable artifact ID." - }, - "name": { - "type": "string", - "title": "Artifact name" - }, - "vendor": { - "type": "string", - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL." - }, - "location_id": { - "type": "string", - "description": "Machine-readable location ID." - }, - "location_name": { - "type": "string", - "description": "Location name." - }, - "service_id": { - "type": "string", - "description": "Machine-readable service ID." - }, - "service_name": { - "type": "string", - "description": "Service name." - }, - "data_model": { - "$ref": "#/definitions/v1DataModel", - "description": "Backup data model." - }, - "status": { - "$ref": "#/definitions/v1BackupStatus", - "description": "Backup status." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Artifact creation time." - }, - "mode": { - "$ref": "#/definitions/v1BackupMode", - "description": "Backup mode." - }, - "is_sharded_cluster": { - "type": "boolean", - "description": "Source database setup type." - }, - "folder": { - "type": "string", - "description": "Folder to store artifact on a storage." - }, - "metadata_list": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Metadata" - }, - "description": "List of artifact metadata." - } - }, - "description": "Artifact represents single backup artifact." - }, - "v1BackupMode": { - "type": "string", - "enum": [ - "BACKUP_MODE_UNSPECIFIED", - "BACKUP_MODE_SNAPSHOT", - "BACKUP_MODE_INCREMENTAL", - "BACKUP_MODE_PITR" - ], - "default": "BACKUP_MODE_UNSPECIFIED", - "description": "BackupMode specifies backup mode." - }, - "v1BackupStatus": { - "type": "string", - "enum": [ - "BACKUP_STATUS_UNSPECIFIED", - "BACKUP_STATUS_PENDING", - "BACKUP_STATUS_IN_PROGRESS", - "BACKUP_STATUS_PAUSED", - "BACKUP_STATUS_SUCCESS", - "BACKUP_STATUS_ERROR", - "BACKUP_STATUS_DELETING", - "BACKUP_STATUS_FAILED_TO_DELETE", - "BACKUP_STATUS_CLEANUP_IN_PROGRESS" - ], - "default": "BACKUP_STATUS_UNSPECIFIED", - "description": "BackupStatus shows the current status of execution of backup." - }, - "v1ChangeScheduledBackupRequest": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string" - }, - "enabled": { - "type": "boolean", - "x-nullable": true - }, - "cron_expression": { - "type": "string", - "x-nullable": true, - "description": "How often backup should be run in cron format." - }, - "start_time": { - "type": "string", - "format": "date-time", - "description": "First backup wouldn't happen before this time." - }, - "name": { - "type": "string", - "x-nullable": true, - "description": "Name of backup." - }, - "description": { - "type": "string", - "x-nullable": true, - "description": "Human-readable description." - }, - "retries": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "description": "How many times to retry a failed backup before giving up." - }, - "retry_interval": { - "type": "string", - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h." - }, - "retention": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "description": "How many artifacts keep. 0 - unlimited." - } - } - }, - "v1ChangeScheduledBackupResponse": { - "type": "object" - }, - "v1DataModel": { - "type": "string", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "default": "DATA_MODEL_UNSPECIFIED", - "description": "DataModel is a model used for performing a backup." - }, - "v1DeleteArtifactResponse": { - "type": "object" - }, - "v1File": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "is_directory": { - "type": "boolean" - } - }, - "description": "File represents file or folder on a storage." - }, - "v1GetLogsResponse": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1LogChunk" - } - }, - "end": { - "type": "boolean" - } - } - }, - "v1ListArtifactCompatibleServicesResponse": { - "type": "object", - "properties": { - "mysql": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1MySQLService" - } - }, - "mongodb": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1MongoDBService" - } - } - } - }, - "v1ListArtifactsResponse": { - "type": "object", - "properties": { - "artifacts": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Artifact" - } - } - } - }, - "v1ListPitrTimerangesResponse": { - "type": "object", - "properties": { - "timeranges": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1PitrTimerange" - } - } - } - }, - "v1ListScheduledBackupsResponse": { - "type": "object", - "properties": { - "scheduled_backups": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1ScheduledBackup" - } - } - } - }, - "v1LogChunk": { - "type": "object", - "properties": { - "chunk_id": { - "type": "integer", - "format": "int64" - }, - "data": { - "type": "string" - } - }, - "description": "LogChunk represent one chunk of logs." - }, - "v1Metadata": { - "type": "object", - "properties": { - "file_list": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1File" - }, - "description": "List of files backup consists of." - }, - "restore_to": { - "type": "string", - "format": "date-time", - "description": "Exact time DB can be restored to." - }, - "pbm_metadata": { - "$ref": "#/definitions/v1PbmMetadata" - } - }, - "description": "Metadata contains extra artifact data like files it consists of, tool specific data, etc." - }, - "v1MongoDBService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "version": { - "type": "string", - "description": "MongoDB version." - } - }, - "description": "MongoDBService represents a generic MongoDB instance." - }, - "v1MySQLService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "version": { - "type": "string", - "description": "MySQL version." - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra parameters to be added to the DSN." - } - }, - "description": "MySQLService represents a generic MySQL instance." - }, - "v1PbmMetadata": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of backup in backup tool representation." - } - }, - "description": "PbmMetadata contains additional data for pbm cli tools." - }, - "v1PitrTimerange": { - "type": "object", - "properties": { - "start_timestamp": { - "type": "string", - "format": "date-time", - "description": "start_timestamp is the time of the first event in the PITR chunk." - }, - "end_timestamp": { - "type": "string", - "format": "date-time", - "description": "end_timestamp is the time of the last event in the PITR chunk." - } - } - }, - "v1RemoveScheduledBackupResponse": { - "type": "object" - }, - "v1ScheduleBackupRequest": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Service identifier where backup should be performed." - }, - "location_id": { - "type": "string", - "description": "Machine-readable location ID." - }, - "folder": { - "type": "string", - "description": "How often backup should be run in cron format.\nFolder on storage for artifact." - }, - "cron_expression": { - "type": "string" - }, - "start_time": { - "type": "string", - "format": "date-time", - "description": "First backup wouldn't happen before this time." - }, - "name": { - "type": "string", - "description": "Name of backup." - }, - "description": { - "type": "string", - "description": "Human-readable description." - }, - "enabled": { - "type": "boolean", - "description": "If scheduling is enabled." - }, - "retries": { - "type": "integer", - "format": "int64", - "description": "How many times to retry a failed backup before giving up." - }, - "retry_interval": { - "type": "string", - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h." - }, - "mode": { - "$ref": "#/definitions/v1BackupMode", - "description": "Backup mode." - }, - "data_model": { - "$ref": "#/definitions/v1DataModel", - "description": "Backup data model (physical or logical)." - }, - "retention": { - "type": "integer", - "format": "int64", - "description": "How many artifacts keep. 0 - unlimited." - } - } - }, - "v1ScheduleBackupResponse": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string" - } - } - }, - "v1ScheduledBackup": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string", - "description": "Machine-readable ID." - }, - "service_id": { - "type": "string", - "description": "Machine-readable service ID." - }, - "service_name": { - "type": "string", - "description": "Service name." - }, - "location_id": { - "type": "string", - "description": "Machine-readable location ID." - }, - "location_name": { - "type": "string", - "description": "Location name." - }, - "folder": { - "type": "string", - "description": "Folder on storage for artifact." - }, - "cron_expression": { - "type": "string", - "description": "How often backup will be run in cron format." - }, - "start_time": { - "type": "string", - "format": "date-time", - "description": "First backup wouldn't happen before this time." - }, - "name": { - "type": "string", - "description": "Artifact name." - }, - "description": { - "type": "string", - "description": "Description." - }, - "enabled": { - "type": "boolean", - "description": "If scheduling is enabled." - }, - "retries": { - "type": "integer", - "format": "int64", - "description": "How many times to retry a failed backup before giving up." - }, - "retry_interval": { - "type": "string", - "description": "Delay between each retry. Should have a suffix in JSON: 2s, 1m, 1h." - }, - "data_model": { - "$ref": "#/definitions/v1DataModel", - "description": "Backup data model (physical or logical)." - }, - "mode": { - "$ref": "#/definitions/v1BackupMode", - "description": "Backup mode." - }, - "vendor": { - "type": "string", - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL." - }, - "last_run": { - "type": "string", - "format": "date-time", - "description": "Last run." - }, - "next_run": { - "type": "string", - "format": "date-time", - "description": "Next run." - }, - "retention": { - "type": "integer", - "format": "int64", - "description": "How many artifacts keep. 0 - unlimited." - } - }, - "description": "ScheduledBackup represents scheduled task for backup." - }, - "v1StartBackupRequest": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "location_id": { - "type": "string", - "description": "Machine-readable location ID." - }, - "name": { - "type": "string", - "description": "If empty then name is auto-generated." - }, - "description": { - "type": "string", - "description": "Human-readable description." - }, - "retry_interval": { - "type": "string", - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h." - }, - "retries": { - "type": "integer", - "format": "int64", - "description": "How many times to retry a failed backup before giving up." - }, - "data_model": { - "$ref": "#/definitions/v1DataModel", - "description": "DataModel represents the data model used for the backup." - }, - "folder": { - "type": "string", - "description": "Folder on storage for artifact." - } - } - }, - "v1StartBackupResponse": { - "type": "object", - "properties": { - "artifact_id": { - "type": "string", - "description": "Unique identifier." - } - } - } - } -} diff --git a/api/backup/v1/backup_grpc.pb.go b/api/backup/v1/backup_grpc.pb.go index 6d16ad2b7de..2f28a3ab987 100644 --- a/api/backup/v1/backup_grpc.pb.go +++ b/api/backup/v1/backup_grpc.pb.go @@ -8,6 +8,7 @@ package backupv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -206,30 +207,39 @@ type UnimplementedBackupServiceServer struct{} func (UnimplementedBackupServiceServer) StartBackup(context.Context, *StartBackupRequest) (*StartBackupResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartBackup not implemented") } + func (UnimplementedBackupServiceServer) ListArtifactCompatibleServices(context.Context, *ListArtifactCompatibleServicesRequest) (*ListArtifactCompatibleServicesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListArtifactCompatibleServices not implemented") } + func (UnimplementedBackupServiceServer) ScheduleBackup(context.Context, *ScheduleBackupRequest) (*ScheduleBackupResponse, error) { return nil, status.Error(codes.Unimplemented, "method ScheduleBackup not implemented") } + func (UnimplementedBackupServiceServer) ListScheduledBackups(context.Context, *ListScheduledBackupsRequest) (*ListScheduledBackupsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListScheduledBackups not implemented") } + func (UnimplementedBackupServiceServer) ChangeScheduledBackup(context.Context, *ChangeScheduledBackupRequest) (*ChangeScheduledBackupResponse, error) { return nil, status.Error(codes.Unimplemented, "method ChangeScheduledBackup not implemented") } + func (UnimplementedBackupServiceServer) RemoveScheduledBackup(context.Context, *RemoveScheduledBackupRequest) (*RemoveScheduledBackupResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveScheduledBackup not implemented") } + func (UnimplementedBackupServiceServer) GetLogs(context.Context, *GetLogsRequest) (*GetLogsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetLogs not implemented") } + func (UnimplementedBackupServiceServer) ListArtifacts(context.Context, *ListArtifactsRequest) (*ListArtifactsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListArtifacts not implemented") } + func (UnimplementedBackupServiceServer) DeleteArtifact(context.Context, *DeleteArtifactRequest) (*DeleteArtifactResponse, error) { return nil, status.Error(codes.Unimplemented, "method DeleteArtifact not implemented") } + func (UnimplementedBackupServiceServer) ListPitrTimeranges(context.Context, *ListPitrTimerangesRequest) (*ListPitrTimerangesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListPitrTimeranges not implemented") } diff --git a/api/backup/v1/common.pb.go b/api/backup/v1/common.pb.go index da7f4a0678c..ca4ba8be172 100644 --- a/api/backup/v1/common.pb.go +++ b/api/backup/v1/common.pb.go @@ -7,13 +7,14 @@ package backupv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" ) const ( @@ -409,17 +410,20 @@ func file_backup_v1_common_proto_rawDescGZIP() []byte { return file_backup_v1_common_proto_rawDescData } -var file_backup_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_backup_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_backup_v1_common_proto_goTypes = []any{ - (DataModel)(0), // 0: backup.v1.DataModel - (BackupMode)(0), // 1: backup.v1.BackupMode - (*File)(nil), // 2: backup.v1.File - (*PbmMetadata)(nil), // 3: backup.v1.PbmMetadata - (*Metadata)(nil), // 4: backup.v1.Metadata - (*LogChunk)(nil), // 5: backup.v1.LogChunk - (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp -} +var ( + file_backup_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) + file_backup_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 4) + file_backup_v1_common_proto_goTypes = []any{ + (DataModel)(0), // 0: backup.v1.DataModel + (BackupMode)(0), // 1: backup.v1.BackupMode + (*File)(nil), // 2: backup.v1.File + (*PbmMetadata)(nil), // 3: backup.v1.PbmMetadata + (*Metadata)(nil), // 4: backup.v1.Metadata + (*LogChunk)(nil), // 5: backup.v1.LogChunk + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp + } +) + var file_backup_v1_common_proto_depIdxs = []int32{ 2, // 0: backup.v1.Metadata.file_list:type_name -> backup.v1.File 6, // 1: backup.v1.Metadata.restore_to:type_name -> google.protobuf.Timestamp diff --git a/api/backup/v1/common.swagger.json b/api/backup/v1/common.swagger.json deleted file mode 100644 index 4e41fc07567..00000000000 --- a/api/backup/v1/common.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "backup/v1/common.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/backup/v1/errors.pb.go b/api/backup/v1/errors.pb.go index a9645403e6b..d67aecce84c 100644 --- a/api/backup/v1/errors.pb.go +++ b/api/backup/v1/errors.pb.go @@ -7,11 +7,12 @@ package backupv1 import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -160,12 +161,15 @@ func file_backup_v1_errors_proto_rawDescGZIP() []byte { return file_backup_v1_errors_proto_rawDescData } -var file_backup_v1_errors_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_backup_v1_errors_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_backup_v1_errors_proto_goTypes = []any{ - (ErrorCode)(0), // 0: backup.v1.ErrorCode - (*Error)(nil), // 1: backup.v1.Error -} +var ( + file_backup_v1_errors_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_backup_v1_errors_proto_msgTypes = make([]protoimpl.MessageInfo, 1) + file_backup_v1_errors_proto_goTypes = []any{ + (ErrorCode)(0), // 0: backup.v1.ErrorCode + (*Error)(nil), // 1: backup.v1.Error + } +) + var file_backup_v1_errors_proto_depIdxs = []int32{ 0, // 0: backup.v1.Error.code:type_name -> backup.v1.ErrorCode 1, // [1:1] is the sub-list for method output_type diff --git a/api/backup/v1/errors.swagger.json b/api/backup/v1/errors.swagger.json deleted file mode 100644 index 59e7b363676..00000000000 --- a/api/backup/v1/errors.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "backup/v1/errors.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/backup/v1/locations.pb.go b/api/backup/v1/locations.pb.go index f0f1c7b8280..808bad5ba2a 100644 --- a/api/backup/v1/locations.pb.go +++ b/api/backup/v1/locations.pb.go @@ -7,14 +7,15 @@ package backupv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" ) const ( @@ -812,22 +813,25 @@ func file_backup_v1_locations_proto_rawDescGZIP() []byte { return file_backup_v1_locations_proto_rawDescData } -var file_backup_v1_locations_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_backup_v1_locations_proto_goTypes = []any{ - (*FilesystemLocationConfig)(nil), // 0: backup.v1.FilesystemLocationConfig - (*S3LocationConfig)(nil), // 1: backup.v1.S3LocationConfig - (*Location)(nil), // 2: backup.v1.Location - (*ListLocationsRequest)(nil), // 3: backup.v1.ListLocationsRequest - (*ListLocationsResponse)(nil), // 4: backup.v1.ListLocationsResponse - (*AddLocationRequest)(nil), // 5: backup.v1.AddLocationRequest - (*AddLocationResponse)(nil), // 6: backup.v1.AddLocationResponse - (*ChangeLocationRequest)(nil), // 7: backup.v1.ChangeLocationRequest - (*ChangeLocationResponse)(nil), // 8: backup.v1.ChangeLocationResponse - (*RemoveLocationRequest)(nil), // 9: backup.v1.RemoveLocationRequest - (*RemoveLocationResponse)(nil), // 10: backup.v1.RemoveLocationResponse - (*TestLocationConfigRequest)(nil), // 11: backup.v1.TestLocationConfigRequest - (*TestLocationConfigResponse)(nil), // 12: backup.v1.TestLocationConfigResponse -} +var ( + file_backup_v1_locations_proto_msgTypes = make([]protoimpl.MessageInfo, 13) + file_backup_v1_locations_proto_goTypes = []any{ + (*FilesystemLocationConfig)(nil), // 0: backup.v1.FilesystemLocationConfig + (*S3LocationConfig)(nil), // 1: backup.v1.S3LocationConfig + (*Location)(nil), // 2: backup.v1.Location + (*ListLocationsRequest)(nil), // 3: backup.v1.ListLocationsRequest + (*ListLocationsResponse)(nil), // 4: backup.v1.ListLocationsResponse + (*AddLocationRequest)(nil), // 5: backup.v1.AddLocationRequest + (*AddLocationResponse)(nil), // 6: backup.v1.AddLocationResponse + (*ChangeLocationRequest)(nil), // 7: backup.v1.ChangeLocationRequest + (*ChangeLocationResponse)(nil), // 8: backup.v1.ChangeLocationResponse + (*RemoveLocationRequest)(nil), // 9: backup.v1.RemoveLocationRequest + (*RemoveLocationResponse)(nil), // 10: backup.v1.RemoveLocationResponse + (*TestLocationConfigRequest)(nil), // 11: backup.v1.TestLocationConfigRequest + (*TestLocationConfigResponse)(nil), // 12: backup.v1.TestLocationConfigResponse + } +) + var file_backup_v1_locations_proto_depIdxs = []int32{ 0, // 0: backup.v1.Location.filesystem_config:type_name -> backup.v1.FilesystemLocationConfig 1, // 1: backup.v1.Location.s3_config:type_name -> backup.v1.S3LocationConfig diff --git a/api/backup/v1/locations.swagger.json b/api/backup/v1/locations.swagger.json deleted file mode 100644 index 26f36fcb836..00000000000 --- a/api/backup/v1/locations.swagger.json +++ /dev/null @@ -1,353 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "backup/v1/locations.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "LocationsService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/backups/locations": { - "get": { - "summary": "List Backup Locations", - "description": "List backup locations.", - "operationId": "ListLocations", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListLocationsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "LocationsService" - ] - }, - "post": { - "summary": "Add a Backup Location", - "description": "Add a backup location.", - "operationId": "AddLocation", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1AddLocationResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1AddLocationRequest" - } - } - ], - "tags": [ - "LocationsService" - ] - } - }, - "/v1/backups/locations/{location_id}": { - "delete": { - "summary": "Remove a Scheduled Backup", - "description": "Remove a backup location.", - "operationId": "RemoveLocation", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1RemoveLocationResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "location_id", - "description": "Machine-readable ID.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "force", - "description": "Force mode", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "tags": [ - "LocationsService" - ] - }, - "put": { - "summary": "Change a Backup Location", - "description": "Change a backup location.", - "operationId": "ChangeLocation", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ChangeLocationResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "location_id", - "description": "Machine-readable ID.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/LocationsServiceChangeLocationBody" - } - } - ], - "tags": [ - "LocationsService" - ] - } - }, - "/v1/backups/locations:testConfig": { - "post": { - "summary": "Test a Backup Location and Credentials", - "description": "Test a backup location and credentials.", - "operationId": "TestLocationConfig", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1TestLocationConfigResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1TestLocationConfigRequest" - } - } - ], - "tags": [ - "LocationsService" - ] - } - } - }, - "definitions": { - "LocationsServiceChangeLocationBody": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Location name" - }, - "description": { - "type": "string" - }, - "filesystem_config": { - "$ref": "#/definitions/v1FilesystemLocationConfig", - "description": "Filesystem location configuration. Exactly one config should be set." - }, - "s3_config": { - "$ref": "#/definitions/v1S3LocationConfig", - "description": "S3 Bucket configuration. Exactly one config should be set." - } - } - }, - "backupV1Location": { - "type": "object", - "properties": { - "location_id": { - "type": "string", - "description": "Machine-readable ID." - }, - "name": { - "type": "string", - "title": "Location name" - }, - "description": { - "type": "string", - "title": "Short description" - }, - "filesystem_config": { - "$ref": "#/definitions/v1FilesystemLocationConfig" - }, - "s3_config": { - "$ref": "#/definitions/v1S3LocationConfig" - } - }, - "description": "Location represents single Backup Location." - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1AddLocationRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Location name" - }, - "description": { - "type": "string" - }, - "filesystem_config": { - "$ref": "#/definitions/v1FilesystemLocationConfig", - "description": "Filesystem location configuration. Exactly one config should be set." - }, - "s3_config": { - "$ref": "#/definitions/v1S3LocationConfig", - "description": "S3 Bucket configuration. Exactly one config should be set." - } - } - }, - "v1AddLocationResponse": { - "type": "object", - "properties": { - "location_id": { - "type": "string", - "description": "Machine-readable ID." - } - } - }, - "v1ChangeLocationResponse": { - "type": "object" - }, - "v1FilesystemLocationConfig": { - "type": "object", - "properties": { - "path": { - "type": "string" - } - }, - "description": "FilesystemLocationConfig represents file system location config." - }, - "v1ListLocationsResponse": { - "type": "object", - "properties": { - "locations": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/backupV1Location" - } - } - } - }, - "v1RemoveLocationResponse": { - "type": "object" - }, - "v1S3LocationConfig": { - "type": "object", - "properties": { - "endpoint": { - "type": "string" - }, - "access_key": { - "type": "string" - }, - "secret_key": { - "type": "string" - }, - "bucket_name": { - "type": "string" - } - }, - "description": "S3LocationConfig represents S3 bucket configuration." - }, - "v1TestLocationConfigRequest": { - "type": "object", - "properties": { - "filesystem_config": { - "$ref": "#/definitions/v1FilesystemLocationConfig", - "description": "Filesystem location configuration. Exactly one config should be set." - }, - "s3_config": { - "$ref": "#/definitions/v1S3LocationConfig", - "description": "S3 Bucket configuration. Exactly one config should be set." - } - } - }, - "v1TestLocationConfigResponse": { - "type": "object" - } - } -} diff --git a/api/backup/v1/locations_grpc.pb.go b/api/backup/v1/locations_grpc.pb.go index 628344a5a7c..15b1c781046 100644 --- a/api/backup/v1/locations_grpc.pb.go +++ b/api/backup/v1/locations_grpc.pb.go @@ -8,6 +8,7 @@ package backupv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -131,15 +132,19 @@ type UnimplementedLocationsServiceServer struct{} func (UnimplementedLocationsServiceServer) ListLocations(context.Context, *ListLocationsRequest) (*ListLocationsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListLocations not implemented") } + func (UnimplementedLocationsServiceServer) AddLocation(context.Context, *AddLocationRequest) (*AddLocationResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddLocation not implemented") } + func (UnimplementedLocationsServiceServer) ChangeLocation(context.Context, *ChangeLocationRequest) (*ChangeLocationResponse, error) { return nil, status.Error(codes.Unimplemented, "method ChangeLocation not implemented") } + func (UnimplementedLocationsServiceServer) RemoveLocation(context.Context, *RemoveLocationRequest) (*RemoveLocationResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveLocation not implemented") } + func (UnimplementedLocationsServiceServer) TestLocationConfig(context.Context, *TestLocationConfigRequest) (*TestLocationConfigResponse, error) { return nil, status.Error(codes.Unimplemented, "method TestLocationConfig not implemented") } diff --git a/api/backup/v1/restores.pb.go b/api/backup/v1/restores.pb.go index 04d7b270102..272b5255d28 100644 --- a/api/backup/v1/restores.pb.go +++ b/api/backup/v1/restores.pb.go @@ -7,15 +7,16 @@ package backupv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" ) const ( @@ -607,21 +608,24 @@ func file_backup_v1_restores_proto_rawDescGZIP() []byte { return file_backup_v1_restores_proto_rawDescData } -var file_backup_v1_restores_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_backup_v1_restores_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_backup_v1_restores_proto_goTypes = []any{ - (RestoreStatus)(0), // 0: backup.v1.RestoreStatus - (*RestoreHistoryItem)(nil), // 1: backup.v1.RestoreHistoryItem - (*ListRestoresRequest)(nil), // 2: backup.v1.ListRestoresRequest - (*ListRestoresResponse)(nil), // 3: backup.v1.ListRestoresResponse - (*RestoreServiceGetLogsRequest)(nil), // 4: backup.v1.RestoreServiceGetLogsRequest - (*RestoreServiceGetLogsResponse)(nil), // 5: backup.v1.RestoreServiceGetLogsResponse - (*RestoreBackupRequest)(nil), // 6: backup.v1.RestoreBackupRequest - (*RestoreBackupResponse)(nil), // 7: backup.v1.RestoreBackupResponse - (DataModel)(0), // 8: backup.v1.DataModel - (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp - (*LogChunk)(nil), // 10: backup.v1.LogChunk -} +var ( + file_backup_v1_restores_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_backup_v1_restores_proto_msgTypes = make([]protoimpl.MessageInfo, 7) + file_backup_v1_restores_proto_goTypes = []any{ + (RestoreStatus)(0), // 0: backup.v1.RestoreStatus + (*RestoreHistoryItem)(nil), // 1: backup.v1.RestoreHistoryItem + (*ListRestoresRequest)(nil), // 2: backup.v1.ListRestoresRequest + (*ListRestoresResponse)(nil), // 3: backup.v1.ListRestoresResponse + (*RestoreServiceGetLogsRequest)(nil), // 4: backup.v1.RestoreServiceGetLogsRequest + (*RestoreServiceGetLogsResponse)(nil), // 5: backup.v1.RestoreServiceGetLogsResponse + (*RestoreBackupRequest)(nil), // 6: backup.v1.RestoreBackupRequest + (*RestoreBackupResponse)(nil), // 7: backup.v1.RestoreBackupResponse + (DataModel)(0), // 8: backup.v1.DataModel + (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp + (*LogChunk)(nil), // 10: backup.v1.LogChunk + } +) + var file_backup_v1_restores_proto_depIdxs = []int32{ 8, // 0: backup.v1.RestoreHistoryItem.data_model:type_name -> backup.v1.DataModel 0, // 1: backup.v1.RestoreHistoryItem.status:type_name -> backup.v1.RestoreStatus diff --git a/api/backup/v1/restores.swagger.json b/api/backup/v1/restores.swagger.json deleted file mode 100644 index e7089206289..00000000000 --- a/api/backup/v1/restores.swagger.json +++ /dev/null @@ -1,303 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "backup/v1/restores.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "RestoreService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/backups/restores": { - "get": { - "summary": "List Restore History", - "description": "List all backup restore history items", - "operationId": "ListRestores", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListRestoresResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "RestoreService" - ] - } - }, - "/v1/backups/restores/{restore_id}/logs": { - "get": { - "summary": "Get Logs", - "description": "Get logs from the underlying tools for a restore job", - "operationId": "GetLogs", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1RestoreServiceGetLogsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "restore_id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "tags": [ - "RestoreService" - ] - } - }, - "/v1/backups/restores:start": { - "post": { - "summary": "Restore from a Backup", - "description": "Could return the Error message in the details containing specific ErrorCode indicating failure reason:\nERROR_CODE_XTRABACKUP_NOT_INSTALLED - xtrabackup is not installed on the service\nERROR_CODE_INVALID_XTRABACKUP - different versions of xtrabackup and xbcloud\nERROR_CODE_INCOMPATIBLE_XTRABACKUP - xtrabackup is not compatible with MySQL for taking a backup\nERROR_CODE_INCOMPATIBLE_TARGET_MYSQL - target MySQL version is not compatible with the artifact for performing a restore of the backup", - "operationId": "RestoreBackup", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1RestoreBackupResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1RestoreBackupRequest" - } - } - ], - "tags": [ - "RestoreService" - ] - } - } - }, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1DataModel": { - "type": "string", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "default": "DATA_MODEL_UNSPECIFIED", - "description": "DataModel is a model used for performing a backup." - }, - "v1ListRestoresResponse": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1RestoreHistoryItem" - } - } - } - }, - "v1LogChunk": { - "type": "object", - "properties": { - "chunk_id": { - "type": "integer", - "format": "int64" - }, - "data": { - "type": "string" - } - }, - "description": "LogChunk represent one chunk of logs." - }, - "v1RestoreBackupRequest": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Service identifier where backup should be restored." - }, - "artifact_id": { - "type": "string", - "description": "Artifact id to restore." - }, - "pitr_timestamp": { - "type": "string", - "format": "date-time", - "title": "Timestamp of PITR to restore to" - } - } - }, - "v1RestoreBackupResponse": { - "type": "object", - "properties": { - "restore_id": { - "type": "string", - "description": "Unique restore identifier." - } - } - }, - "v1RestoreHistoryItem": { - "type": "object", - "properties": { - "restore_id": { - "type": "string", - "description": "Machine-readable restore id." - }, - "artifact_id": { - "type": "string", - "description": "ID of the artifact used for restore." - }, - "name": { - "type": "string", - "description": "Artifact name used for restore." - }, - "vendor": { - "type": "string", - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL." - }, - "location_id": { - "type": "string", - "description": "Machine-readable location ID." - }, - "location_name": { - "type": "string", - "description": "Location name." - }, - "service_id": { - "type": "string", - "description": "Machine-readable service ID." - }, - "service_name": { - "type": "string", - "description": "Service name." - }, - "data_model": { - "$ref": "#/definitions/v1DataModel", - "description": "Backup data model." - }, - "status": { - "$ref": "#/definitions/v1RestoreStatus", - "description": "Restore status." - }, - "started_at": { - "type": "string", - "format": "date-time", - "description": "Restore start time." - }, - "finished_at": { - "type": "string", - "format": "date-time", - "description": "Restore finish time." - }, - "pitr_timestamp": { - "type": "string", - "format": "date-time", - "description": "PITR timestamp is filled for PITR restores, empty otherwise." - } - }, - "description": "RestoreHistoryItem represents single backup restore item." - }, - "v1RestoreServiceGetLogsResponse": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1LogChunk" - } - }, - "end": { - "type": "boolean" - } - } - }, - "v1RestoreStatus": { - "type": "string", - "enum": [ - "RESTORE_STATUS_UNSPECIFIED", - "RESTORE_STATUS_IN_PROGRESS", - "RESTORE_STATUS_SUCCESS", - "RESTORE_STATUS_ERROR" - ], - "default": "RESTORE_STATUS_UNSPECIFIED", - "description": "RestoreStatus shows the current status of execution of restore." - } - } -} diff --git a/api/backup/v1/restores_grpc.pb.go b/api/backup/v1/restores_grpc.pb.go index a7fdce1c5f0..c27c45e9f4e 100644 --- a/api/backup/v1/restores_grpc.pb.go +++ b/api/backup/v1/restores_grpc.pb.go @@ -8,6 +8,7 @@ package backupv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -101,9 +102,11 @@ type UnimplementedRestoreServiceServer struct{} func (UnimplementedRestoreServiceServer) ListRestores(context.Context, *ListRestoresRequest) (*ListRestoresResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListRestores not implemented") } + func (UnimplementedRestoreServiceServer) GetLogs(context.Context, *RestoreServiceGetLogsRequest) (*RestoreServiceGetLogsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetLogs not implemented") } + func (UnimplementedRestoreServiceServer) RestoreBackup(context.Context, *RestoreBackupRequest) (*RestoreBackupResponse, error) { return nil, status.Error(codes.Unimplemented, "method RestoreBackup not implemented") } diff --git a/api/common/common.pb.go b/api/common/common.pb.go index 5c809939700..0d05883daa1 100644 --- a/api/common/common.pb.go +++ b/api/common/common.pb.go @@ -7,11 +7,12 @@ package common import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -138,12 +139,15 @@ func file_common_common_proto_rawDescGZIP() []byte { return file_common_common_proto_rawDescData } -var file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_common_common_proto_goTypes = []any{ - (*StringArray)(nil), // 0: common.StringArray - (*StringMap)(nil), // 1: common.StringMap - nil, // 2: common.StringMap.ValuesEntry -} +var ( + file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 3) + file_common_common_proto_goTypes = []any{ + (*StringArray)(nil), // 0: common.StringArray + (*StringMap)(nil), // 1: common.StringMap + nil, // 2: common.StringMap.ValuesEntry + } +) + var file_common_common_proto_depIdxs = []int32{ 2, // 0: common.StringMap.values:type_name -> common.StringMap.ValuesEntry 1, // [1:1] is the sub-list for method output_type diff --git a/api/common/common.swagger.json b/api/common/common.swagger.json deleted file mode 100644 index 613dea17f41..00000000000 --- a/api/common/common.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "common/common.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/common/metrics_resolutions.pb.go b/api/common/metrics_resolutions.pb.go index 30e99f3894f..75e587ba9a5 100644 --- a/api/common/metrics_resolutions.pb.go +++ b/api/common/metrics_resolutions.pb.go @@ -7,12 +7,13 @@ package common import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" ) const ( @@ -110,11 +111,14 @@ func file_common_metrics_resolutions_proto_rawDescGZIP() []byte { return file_common_metrics_resolutions_proto_rawDescData } -var file_common_metrics_resolutions_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_common_metrics_resolutions_proto_goTypes = []any{ - (*MetricsResolutions)(nil), // 0: common.MetricsResolutions - (*durationpb.Duration)(nil), // 1: google.protobuf.Duration -} +var ( + file_common_metrics_resolutions_proto_msgTypes = make([]protoimpl.MessageInfo, 1) + file_common_metrics_resolutions_proto_goTypes = []any{ + (*MetricsResolutions)(nil), // 0: common.MetricsResolutions + (*durationpb.Duration)(nil), // 1: google.protobuf.Duration + } +) + var file_common_metrics_resolutions_proto_depIdxs = []int32{ 1, // 0: common.MetricsResolutions.hr:type_name -> google.protobuf.Duration 1, // 1: common.MetricsResolutions.mr:type_name -> google.protobuf.Duration diff --git a/api/common/metrics_resolutions.swagger.json b/api/common/metrics_resolutions.swagger.json deleted file mode 100644 index 995cc971e4a..00000000000 --- a/api/common/metrics_resolutions.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "common/metrics_resolutions.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/dump/v1beta1/dump.pb.go b/api/dump/v1beta1/dump.pb.go index e9e73ce9e7d..3cd88013859 100644 --- a/api/dump/v1beta1/dump.pb.go +++ b/api/dump/v1beta1/dump.pb.go @@ -7,15 +7,16 @@ package dumpv1beta1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" ) const ( @@ -843,25 +844,28 @@ func file_dump_v1beta1_dump_proto_rawDescGZIP() []byte { return file_dump_v1beta1_dump_proto_rawDescData } -var file_dump_v1beta1_dump_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_dump_v1beta1_dump_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_dump_v1beta1_dump_proto_goTypes = []any{ - (DumpStatus)(0), // 0: dump.v1beta1.DumpStatus - (*Dump)(nil), // 1: dump.v1beta1.Dump - (*StartDumpRequest)(nil), // 2: dump.v1beta1.StartDumpRequest - (*StartDumpResponse)(nil), // 3: dump.v1beta1.StartDumpResponse - (*ListDumpsRequest)(nil), // 4: dump.v1beta1.ListDumpsRequest - (*ListDumpsResponse)(nil), // 5: dump.v1beta1.ListDumpsResponse - (*DeleteDumpRequest)(nil), // 6: dump.v1beta1.DeleteDumpRequest - (*DeleteDumpResponse)(nil), // 7: dump.v1beta1.DeleteDumpResponse - (*GetDumpLogsRequest)(nil), // 8: dump.v1beta1.GetDumpLogsRequest - (*GetDumpLogsResponse)(nil), // 9: dump.v1beta1.GetDumpLogsResponse - (*LogChunk)(nil), // 10: dump.v1beta1.LogChunk - (*SFTPParameters)(nil), // 11: dump.v1beta1.SFTPParameters - (*UploadDumpRequest)(nil), // 12: dump.v1beta1.UploadDumpRequest - (*UploadDumpResponse)(nil), // 13: dump.v1beta1.UploadDumpResponse - (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp -} +var ( + file_dump_v1beta1_dump_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_dump_v1beta1_dump_proto_msgTypes = make([]protoimpl.MessageInfo, 13) + file_dump_v1beta1_dump_proto_goTypes = []any{ + (DumpStatus)(0), // 0: dump.v1beta1.DumpStatus + (*Dump)(nil), // 1: dump.v1beta1.Dump + (*StartDumpRequest)(nil), // 2: dump.v1beta1.StartDumpRequest + (*StartDumpResponse)(nil), // 3: dump.v1beta1.StartDumpResponse + (*ListDumpsRequest)(nil), // 4: dump.v1beta1.ListDumpsRequest + (*ListDumpsResponse)(nil), // 5: dump.v1beta1.ListDumpsResponse + (*DeleteDumpRequest)(nil), // 6: dump.v1beta1.DeleteDumpRequest + (*DeleteDumpResponse)(nil), // 7: dump.v1beta1.DeleteDumpResponse + (*GetDumpLogsRequest)(nil), // 8: dump.v1beta1.GetDumpLogsRequest + (*GetDumpLogsResponse)(nil), // 9: dump.v1beta1.GetDumpLogsResponse + (*LogChunk)(nil), // 10: dump.v1beta1.LogChunk + (*SFTPParameters)(nil), // 11: dump.v1beta1.SFTPParameters + (*UploadDumpRequest)(nil), // 12: dump.v1beta1.UploadDumpRequest + (*UploadDumpResponse)(nil), // 13: dump.v1beta1.UploadDumpResponse + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp + } +) + var file_dump_v1beta1_dump_proto_depIdxs = []int32{ 0, // 0: dump.v1beta1.Dump.status:type_name -> dump.v1beta1.DumpStatus 14, // 1: dump.v1beta1.Dump.start_time:type_name -> google.protobuf.Timestamp diff --git a/api/dump/v1beta1/dump.swagger.json b/api/dump/v1beta1/dump.swagger.json deleted file mode 100644 index a8f75c5d21d..00000000000 --- a/api/dump/v1beta1/dump.swagger.json +++ /dev/null @@ -1,383 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "dump/v1beta1/dump.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "DumpService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/dumps": { - "get": { - "summary": "List All Dumps", - "description": "List all dumps", - "operationId": "ListDumps", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1ListDumpsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "DumpService" - ] - } - }, - "/v1/dumps/{dump_id}/logs": { - "get": { - "summary": "Get Dump Logs", - "description": "Get logs of a selected dump.", - "operationId": "GetDumpLogs", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1GetDumpLogsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "dump_id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "tags": [ - "DumpService" - ] - } - }, - "/v1/dumps:batchDelete": { - "post": { - "summary": "Delete Dumps", - "description": "Delete selected dumps.", - "operationId": "DeleteDump", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1DeleteDumpResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1beta1DeleteDumpRequest" - } - } - ], - "tags": [ - "DumpService" - ] - } - }, - "/v1/dumps:start": { - "post": { - "summary": "Start a New Dump", - "description": "Start a new dump.", - "operationId": "StartDump", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1StartDumpResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1beta1StartDumpRequest" - } - } - ], - "tags": [ - "DumpService" - ] - } - }, - "/v1/dumps:upload": { - "post": { - "summary": "Upload Dumps", - "description": "Upload selected dumps to a remote server.", - "operationId": "UploadDump", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1UploadDumpResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1beta1UploadDumpRequest" - } - } - ], - "tags": [ - "DumpService" - ] - } - } - }, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1beta1DeleteDumpRequest": { - "type": "object", - "properties": { - "dump_ids": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "v1beta1DeleteDumpResponse": { - "type": "object" - }, - "v1beta1Dump": { - "type": "object", - "properties": { - "dump_id": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/v1beta1DumpStatus" - }, - "service_names": { - "type": "array", - "items": { - "type": "string" - } - }, - "start_time": { - "type": "string", - "format": "date-time" - }, - "end_time": { - "type": "string", - "format": "date-time" - }, - "created_at": { - "type": "string", - "format": "date-time" - } - } - }, - "v1beta1DumpStatus": { - "type": "string", - "enum": [ - "DUMP_STATUS_UNSPECIFIED", - "DUMP_STATUS_IN_PROGRESS", - "DUMP_STATUS_SUCCESS", - "DUMP_STATUS_ERROR" - ], - "default": "DUMP_STATUS_UNSPECIFIED" - }, - "v1beta1GetDumpLogsResponse": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1beta1LogChunk" - } - }, - "end": { - "type": "boolean" - } - } - }, - "v1beta1ListDumpsResponse": { - "type": "object", - "properties": { - "dumps": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1beta1Dump" - } - } - } - }, - "v1beta1LogChunk": { - "type": "object", - "properties": { - "chunk_id": { - "type": "integer", - "format": "int64" - }, - "data": { - "type": "string" - } - }, - "description": "LogChunk represent one chunk of logs." - }, - "v1beta1SFTPParameters": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "user": { - "type": "string" - }, - "password": { - "type": "string" - }, - "directory": { - "type": "string" - } - } - }, - "v1beta1StartDumpRequest": { - "type": "object", - "properties": { - "service_names": { - "type": "array", - "items": { - "type": "string" - } - }, - "start_time": { - "type": "string", - "format": "date-time" - }, - "end_time": { - "type": "string", - "format": "date-time" - }, - "export_qan": { - "type": "boolean" - }, - "ignore_load": { - "type": "boolean" - } - } - }, - "v1beta1StartDumpResponse": { - "type": "object", - "properties": { - "dump_id": { - "type": "string" - } - } - }, - "v1beta1UploadDumpRequest": { - "type": "object", - "properties": { - "dump_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "sftp_parameters": { - "$ref": "#/definitions/v1beta1SFTPParameters", - "description": "SFTP upload parameters." - } - } - }, - "v1beta1UploadDumpResponse": { - "type": "object" - } - } -} diff --git a/api/dump/v1beta1/dump_grpc.pb.go b/api/dump/v1beta1/dump_grpc.pb.go index bb65b07cc1b..987f75bd579 100644 --- a/api/dump/v1beta1/dump_grpc.pb.go +++ b/api/dump/v1beta1/dump_grpc.pb.go @@ -8,6 +8,7 @@ package dumpv1beta1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -127,15 +128,19 @@ type UnimplementedDumpServiceServer struct{} func (UnimplementedDumpServiceServer) StartDump(context.Context, *StartDumpRequest) (*StartDumpResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartDump not implemented") } + func (UnimplementedDumpServiceServer) ListDumps(context.Context, *ListDumpsRequest) (*ListDumpsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListDumps not implemented") } + func (UnimplementedDumpServiceServer) DeleteDump(context.Context, *DeleteDumpRequest) (*DeleteDumpResponse, error) { return nil, status.Error(codes.Unimplemented, "method DeleteDump not implemented") } + func (UnimplementedDumpServiceServer) GetDumpLogs(context.Context, *GetDumpLogsRequest) (*GetDumpLogsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetDumpLogs not implemented") } + func (UnimplementedDumpServiceServer) UploadDump(context.Context, *UploadDumpRequest) (*UploadDumpResponse, error) { return nil, status.Error(codes.Unimplemented, "method UploadDump not implemented") } diff --git a/api/ha/v1beta1/ha.pb.go b/api/ha/v1beta1/ha.pb.go index c592f717052..5b2c2efaf36 100644 --- a/api/ha/v1beta1/ha.pb.go +++ b/api/ha/v1beta1/ha.pb.go @@ -7,13 +7,14 @@ package hav1beta1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" ) const ( @@ -338,16 +339,19 @@ func file_ha_v1beta1_ha_proto_rawDescGZIP() []byte { return file_ha_v1beta1_ha_proto_rawDescData } -var file_ha_v1beta1_ha_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_ha_v1beta1_ha_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_ha_v1beta1_ha_proto_goTypes = []any{ - (NodeRole)(0), // 0: ha.v1beta1.NodeRole - (*ListNodesRequest)(nil), // 1: ha.v1beta1.ListNodesRequest - (*HANode)(nil), // 2: ha.v1beta1.HANode - (*ListNodesResponse)(nil), // 3: ha.v1beta1.ListNodesResponse - (*StatusRequest)(nil), // 4: ha.v1beta1.StatusRequest - (*StatusResponse)(nil), // 5: ha.v1beta1.StatusResponse -} +var ( + file_ha_v1beta1_ha_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_ha_v1beta1_ha_proto_msgTypes = make([]protoimpl.MessageInfo, 5) + file_ha_v1beta1_ha_proto_goTypes = []any{ + (NodeRole)(0), // 0: ha.v1beta1.NodeRole + (*ListNodesRequest)(nil), // 1: ha.v1beta1.ListNodesRequest + (*HANode)(nil), // 2: ha.v1beta1.HANode + (*ListNodesResponse)(nil), // 3: ha.v1beta1.ListNodesResponse + (*StatusRequest)(nil), // 4: ha.v1beta1.StatusRequest + (*StatusResponse)(nil), // 5: ha.v1beta1.StatusResponse + } +) + var file_ha_v1beta1_ha_proto_depIdxs = []int32{ 0, // 0: ha.v1beta1.HANode.role:type_name -> ha.v1beta1.NodeRole 2, // 1: ha.v1beta1.ListNodesResponse.nodes:type_name -> ha.v1beta1.HANode diff --git a/api/ha/v1beta1/ha.swagger.json b/api/ha/v1beta1/ha.swagger.json deleted file mode 100644 index eab5d5f5d2f..00000000000 --- a/api/ha/v1beta1/ha.swagger.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "ha/v1beta1/ha.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "HAService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/ha/nodes": { - "get": { - "summary": "List HA Nodes", - "description": "Returns a list of all nodes in the High Availability cluster with their current status and roles.", - "operationId": "ListNodes", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1ListNodesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "tags": [ - "HAService" - ] - } - }, - "/v1/ha/status": { - "get": { - "summary": "HA Status", - "description": "Returns whether High Availability mode is enabled or disabled.", - "operationId": "Status", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1StatusResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "tags": [ - "HAService" - ] - } - } - }, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "v1beta1HANode": { - "type": "object", - "properties": { - "node_name": { - "type": "string", - "description": "Human-readable name of the node." - }, - "role": { - "$ref": "#/definitions/v1beta1NodeRole", - "description": "Role of the node in the cluster." - }, - "status": { - "type": "string", - "description": "Current status of the node from MemberList." - } - }, - "description": "HANode represents a single node in the HA cluster." - }, - "v1beta1ListNodesResponse": { - "type": "object", - "properties": { - "nodes": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1beta1HANode" - }, - "description": "List of nodes in the HA cluster." - } - } - }, - "v1beta1NodeRole": { - "type": "string", - "enum": [ - "NODE_ROLE_UNSPECIFIED", - "NODE_ROLE_LEADER", - "NODE_ROLE_FOLLOWER" - ], - "default": "NODE_ROLE_UNSPECIFIED", - "description": "NodeRole represents the role of a node in the HA cluster." - }, - "v1beta1StatusResponse": { - "type": "object", - "properties": { - "status": { - "type": "string", - "description": "Status of HA mode: \"Enabled\" or \"Disabled\"." - } - } - } - } -} diff --git a/api/ha/v1beta1/ha_grpc.pb.go b/api/ha/v1beta1/ha_grpc.pb.go index c723d8996be..75e664a29e5 100644 --- a/api/ha/v1beta1/ha_grpc.pb.go +++ b/api/ha/v1beta1/ha_grpc.pb.go @@ -8,6 +8,7 @@ package hav1beta1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -86,6 +87,7 @@ type UnimplementedHAServiceServer struct{} func (UnimplementedHAServiceServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { return nil, status.Error(codes.Unimplemented, "method Status not implemented") } + func (UnimplementedHAServiceServer) ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListNodes not implemented") } diff --git a/api/inventory/v1/agent_status.pb.go b/api/inventory/v1/agent_status.pb.go index 025bb50c788..01af45754b1 100644 --- a/api/inventory/v1/agent_status.pb.go +++ b/api/inventory/v1/agent_status.pb.go @@ -7,11 +7,12 @@ package inventoryv1 import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -121,10 +122,13 @@ func file_inventory_v1_agent_status_proto_rawDescGZIP() []byte { return file_inventory_v1_agent_status_proto_rawDescData } -var file_inventory_v1_agent_status_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_inventory_v1_agent_status_proto_goTypes = []any{ - (AgentStatus)(0), // 0: inventory.v1.AgentStatus -} +var ( + file_inventory_v1_agent_status_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_inventory_v1_agent_status_proto_goTypes = []any{ + (AgentStatus)(0), // 0: inventory.v1.AgentStatus + } +) + var file_inventory_v1_agent_status_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/inventory/v1/agent_status.swagger.json b/api/inventory/v1/agent_status.swagger.json deleted file mode 100644 index 2e9902fb83f..00000000000 --- a/api/inventory/v1/agent_status.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "inventory/v1/agent_status.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/inventory/v1/agents.pb.go b/api/inventory/v1/agents.pb.go index 6b53a101528..e619a04e91a 100644 --- a/api/inventory/v1/agents.pb.go +++ b/api/inventory/v1/agents.pb.go @@ -7,16 +7,18 @@ package inventoryv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - common "github.com/percona/pmm/api/common" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" - reflect "reflect" - sync "sync" - unsafe "unsafe" + + common "github.com/percona/pmm/api/common" ) const ( @@ -12241,123 +12243,126 @@ func file_inventory_v1_agents_proto_rawDescGZIP() []byte { return file_inventory_v1_agents_proto_rawDescData } -var file_inventory_v1_agents_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_inventory_v1_agents_proto_msgTypes = make([]protoimpl.MessageInfo, 107) -var file_inventory_v1_agents_proto_goTypes = []any{ - (AgentType)(0), // 0: inventory.v1.AgentType - (*PMMAgent)(nil), // 1: inventory.v1.PMMAgent - (*VMAgent)(nil), // 2: inventory.v1.VMAgent - (*NomadAgent)(nil), // 3: inventory.v1.NomadAgent - (*NodeExporter)(nil), // 4: inventory.v1.NodeExporter - (*MySQLdExporter)(nil), // 5: inventory.v1.MySQLdExporter - (*MongoDBExporter)(nil), // 6: inventory.v1.MongoDBExporter - (*PostgresExporter)(nil), // 7: inventory.v1.PostgresExporter - (*ProxySQLExporter)(nil), // 8: inventory.v1.ProxySQLExporter - (*ValkeyExporter)(nil), // 9: inventory.v1.ValkeyExporter - (*QANMySQLPerfSchemaAgent)(nil), // 10: inventory.v1.QANMySQLPerfSchemaAgent - (*QANMySQLSlowlogAgent)(nil), // 11: inventory.v1.QANMySQLSlowlogAgent - (*QANMongoDBProfilerAgent)(nil), // 12: inventory.v1.QANMongoDBProfilerAgent - (*QANMongoDBMongologAgent)(nil), // 13: inventory.v1.QANMongoDBMongologAgent - (*RTAOptions)(nil), // 14: inventory.v1.RTAOptions - (*RTAMongoDBAgent)(nil), // 15: inventory.v1.RTAMongoDBAgent - (*QANPostgreSQLPgStatementsAgent)(nil), // 16: inventory.v1.QANPostgreSQLPgStatementsAgent - (*QANPostgreSQLPgStatMonitorAgent)(nil), // 17: inventory.v1.QANPostgreSQLPgStatMonitorAgent - (*RDSExporter)(nil), // 18: inventory.v1.RDSExporter - (*ExternalExporter)(nil), // 19: inventory.v1.ExternalExporter - (*AzureDatabaseExporter)(nil), // 20: inventory.v1.AzureDatabaseExporter - (*ChangeCommonAgentParams)(nil), // 21: inventory.v1.ChangeCommonAgentParams - (*ListAgentsRequest)(nil), // 22: inventory.v1.ListAgentsRequest - (*ListAgentsResponse)(nil), // 23: inventory.v1.ListAgentsResponse - (*GetAgentRequest)(nil), // 24: inventory.v1.GetAgentRequest - (*GetAgentResponse)(nil), // 25: inventory.v1.GetAgentResponse - (*GetAgentLogsRequest)(nil), // 26: inventory.v1.GetAgentLogsRequest - (*GetAgentLogsResponse)(nil), // 27: inventory.v1.GetAgentLogsResponse - (*AddAgentRequest)(nil), // 28: inventory.v1.AddAgentRequest - (*AddAgentResponse)(nil), // 29: inventory.v1.AddAgentResponse - (*ChangeAgentRequest)(nil), // 30: inventory.v1.ChangeAgentRequest - (*ChangeAgentResponse)(nil), // 31: inventory.v1.ChangeAgentResponse - (*AddPMMAgentParams)(nil), // 32: inventory.v1.AddPMMAgentParams - (*AddNodeExporterParams)(nil), // 33: inventory.v1.AddNodeExporterParams - (*ChangeNodeExporterParams)(nil), // 34: inventory.v1.ChangeNodeExporterParams - (*AddMySQLdExporterParams)(nil), // 35: inventory.v1.AddMySQLdExporterParams - (*ChangeMySQLdExporterParams)(nil), // 36: inventory.v1.ChangeMySQLdExporterParams - (*AddMongoDBExporterParams)(nil), // 37: inventory.v1.AddMongoDBExporterParams - (*ChangeMongoDBExporterParams)(nil), // 38: inventory.v1.ChangeMongoDBExporterParams - (*AddPostgresExporterParams)(nil), // 39: inventory.v1.AddPostgresExporterParams - (*ChangePostgresExporterParams)(nil), // 40: inventory.v1.ChangePostgresExporterParams - (*AddProxySQLExporterParams)(nil), // 41: inventory.v1.AddProxySQLExporterParams - (*ChangeProxySQLExporterParams)(nil), // 42: inventory.v1.ChangeProxySQLExporterParams - (*AddQANMySQLPerfSchemaAgentParams)(nil), // 43: inventory.v1.AddQANMySQLPerfSchemaAgentParams - (*ChangeQANMySQLPerfSchemaAgentParams)(nil), // 44: inventory.v1.ChangeQANMySQLPerfSchemaAgentParams - (*AddQANMySQLSlowlogAgentParams)(nil), // 45: inventory.v1.AddQANMySQLSlowlogAgentParams - (*ChangeQANMySQLSlowlogAgentParams)(nil), // 46: inventory.v1.ChangeQANMySQLSlowlogAgentParams - (*AddQANMongoDBProfilerAgentParams)(nil), // 47: inventory.v1.AddQANMongoDBProfilerAgentParams - (*ChangeQANMongoDBProfilerAgentParams)(nil), // 48: inventory.v1.ChangeQANMongoDBProfilerAgentParams - (*AddQANMongoDBMongologAgentParams)(nil), // 49: inventory.v1.AddQANMongoDBMongologAgentParams - (*ChangeQANMongoDBMongologAgentParams)(nil), // 50: inventory.v1.ChangeQANMongoDBMongologAgentParams - (*AddQANPostgreSQLPgStatementsAgentParams)(nil), // 51: inventory.v1.AddQANPostgreSQLPgStatementsAgentParams - (*ChangeQANPostgreSQLPgStatementsAgentParams)(nil), // 52: inventory.v1.ChangeQANPostgreSQLPgStatementsAgentParams - (*AddQANPostgreSQLPgStatMonitorAgentParams)(nil), // 53: inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams - (*ChangeQANPostgreSQLPgStatMonitorAgentParams)(nil), // 54: inventory.v1.ChangeQANPostgreSQLPgStatMonitorAgentParams - (*AddRDSExporterParams)(nil), // 55: inventory.v1.AddRDSExporterParams - (*ChangeRDSExporterParams)(nil), // 56: inventory.v1.ChangeRDSExporterParams - (*AddExternalExporterParams)(nil), // 57: inventory.v1.AddExternalExporterParams - (*ChangeExternalExporterParams)(nil), // 58: inventory.v1.ChangeExternalExporterParams - (*AddAzureDatabaseExporterParams)(nil), // 59: inventory.v1.AddAzureDatabaseExporterParams - (*ChangeAzureDatabaseExporterParams)(nil), // 60: inventory.v1.ChangeAzureDatabaseExporterParams - (*ChangeNomadAgentParams)(nil), // 61: inventory.v1.ChangeNomadAgentParams - (*AddValkeyExporterParams)(nil), // 62: inventory.v1.AddValkeyExporterParams - (*ChangeValkeyExporterParams)(nil), // 63: inventory.v1.ChangeValkeyExporterParams - (*AddRTAMongoDBAgentParams)(nil), // 64: inventory.v1.AddRTAMongoDBAgentParams - (*ChangeRTAMongoDBAgentParams)(nil), // 65: inventory.v1.ChangeRTAMongoDBAgentParams - (*RemoveAgentRequest)(nil), // 66: inventory.v1.RemoveAgentRequest - (*RemoveAgentResponse)(nil), // 67: inventory.v1.RemoveAgentResponse - nil, // 68: inventory.v1.PMMAgent.CustomLabelsEntry - nil, // 69: inventory.v1.NodeExporter.CustomLabelsEntry - nil, // 70: inventory.v1.MySQLdExporter.CustomLabelsEntry - nil, // 71: inventory.v1.MySQLdExporter.ExtraDsnParamsEntry - nil, // 72: inventory.v1.MongoDBExporter.CustomLabelsEntry - nil, // 73: inventory.v1.PostgresExporter.CustomLabelsEntry - nil, // 74: inventory.v1.ProxySQLExporter.CustomLabelsEntry - nil, // 75: inventory.v1.ValkeyExporter.CustomLabelsEntry - nil, // 76: inventory.v1.QANMySQLPerfSchemaAgent.CustomLabelsEntry - nil, // 77: inventory.v1.QANMySQLPerfSchemaAgent.ExtraDsnParamsEntry - nil, // 78: inventory.v1.QANMySQLSlowlogAgent.CustomLabelsEntry - nil, // 79: inventory.v1.QANMySQLSlowlogAgent.ExtraDsnParamsEntry - nil, // 80: inventory.v1.QANMongoDBProfilerAgent.CustomLabelsEntry - nil, // 81: inventory.v1.QANMongoDBMongologAgent.CustomLabelsEntry - nil, // 82: inventory.v1.RTAMongoDBAgent.CustomLabelsEntry - nil, // 83: inventory.v1.QANPostgreSQLPgStatementsAgent.CustomLabelsEntry - nil, // 84: inventory.v1.QANPostgreSQLPgStatMonitorAgent.CustomLabelsEntry - nil, // 85: inventory.v1.RDSExporter.CustomLabelsEntry - nil, // 86: inventory.v1.ExternalExporter.CustomLabelsEntry - nil, // 87: inventory.v1.AzureDatabaseExporter.CustomLabelsEntry - nil, // 88: inventory.v1.AddPMMAgentParams.CustomLabelsEntry - nil, // 89: inventory.v1.AddNodeExporterParams.CustomLabelsEntry - nil, // 90: inventory.v1.AddMySQLdExporterParams.CustomLabelsEntry - nil, // 91: inventory.v1.AddMySQLdExporterParams.ExtraDsnParamsEntry - nil, // 92: inventory.v1.AddMongoDBExporterParams.CustomLabelsEntry - nil, // 93: inventory.v1.AddPostgresExporterParams.CustomLabelsEntry - nil, // 94: inventory.v1.AddProxySQLExporterParams.CustomLabelsEntry - nil, // 95: inventory.v1.AddQANMySQLPerfSchemaAgentParams.CustomLabelsEntry - nil, // 96: inventory.v1.AddQANMySQLPerfSchemaAgentParams.ExtraDsnParamsEntry - nil, // 97: inventory.v1.AddQANMySQLSlowlogAgentParams.CustomLabelsEntry - nil, // 98: inventory.v1.AddQANMySQLSlowlogAgentParams.ExtraDsnParamsEntry - nil, // 99: inventory.v1.AddQANMongoDBProfilerAgentParams.CustomLabelsEntry - nil, // 100: inventory.v1.AddQANMongoDBMongologAgentParams.CustomLabelsEntry - nil, // 101: inventory.v1.AddQANPostgreSQLPgStatementsAgentParams.CustomLabelsEntry - nil, // 102: inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams.CustomLabelsEntry - nil, // 103: inventory.v1.AddRDSExporterParams.CustomLabelsEntry - nil, // 104: inventory.v1.AddExternalExporterParams.CustomLabelsEntry - nil, // 105: inventory.v1.AddAzureDatabaseExporterParams.CustomLabelsEntry - nil, // 106: inventory.v1.AddValkeyExporterParams.CustomLabelsEntry - nil, // 107: inventory.v1.AddRTAMongoDBAgentParams.CustomLabelsEntry - (AgentStatus)(0), // 108: inventory.v1.AgentStatus - (LogLevel)(0), // 109: inventory.v1.LogLevel - (*common.MetricsResolutions)(nil), // 110: common.MetricsResolutions - (*durationpb.Duration)(nil), // 111: google.protobuf.Duration - (*common.StringMap)(nil), // 112: common.StringMap -} +var ( + file_inventory_v1_agents_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_inventory_v1_agents_proto_msgTypes = make([]protoimpl.MessageInfo, 107) + file_inventory_v1_agents_proto_goTypes = []any{ + (AgentType)(0), // 0: inventory.v1.AgentType + (*PMMAgent)(nil), // 1: inventory.v1.PMMAgent + (*VMAgent)(nil), // 2: inventory.v1.VMAgent + (*NomadAgent)(nil), // 3: inventory.v1.NomadAgent + (*NodeExporter)(nil), // 4: inventory.v1.NodeExporter + (*MySQLdExporter)(nil), // 5: inventory.v1.MySQLdExporter + (*MongoDBExporter)(nil), // 6: inventory.v1.MongoDBExporter + (*PostgresExporter)(nil), // 7: inventory.v1.PostgresExporter + (*ProxySQLExporter)(nil), // 8: inventory.v1.ProxySQLExporter + (*ValkeyExporter)(nil), // 9: inventory.v1.ValkeyExporter + (*QANMySQLPerfSchemaAgent)(nil), // 10: inventory.v1.QANMySQLPerfSchemaAgent + (*QANMySQLSlowlogAgent)(nil), // 11: inventory.v1.QANMySQLSlowlogAgent + (*QANMongoDBProfilerAgent)(nil), // 12: inventory.v1.QANMongoDBProfilerAgent + (*QANMongoDBMongologAgent)(nil), // 13: inventory.v1.QANMongoDBMongologAgent + (*RTAOptions)(nil), // 14: inventory.v1.RTAOptions + (*RTAMongoDBAgent)(nil), // 15: inventory.v1.RTAMongoDBAgent + (*QANPostgreSQLPgStatementsAgent)(nil), // 16: inventory.v1.QANPostgreSQLPgStatementsAgent + (*QANPostgreSQLPgStatMonitorAgent)(nil), // 17: inventory.v1.QANPostgreSQLPgStatMonitorAgent + (*RDSExporter)(nil), // 18: inventory.v1.RDSExporter + (*ExternalExporter)(nil), // 19: inventory.v1.ExternalExporter + (*AzureDatabaseExporter)(nil), // 20: inventory.v1.AzureDatabaseExporter + (*ChangeCommonAgentParams)(nil), // 21: inventory.v1.ChangeCommonAgentParams + (*ListAgentsRequest)(nil), // 22: inventory.v1.ListAgentsRequest + (*ListAgentsResponse)(nil), // 23: inventory.v1.ListAgentsResponse + (*GetAgentRequest)(nil), // 24: inventory.v1.GetAgentRequest + (*GetAgentResponse)(nil), // 25: inventory.v1.GetAgentResponse + (*GetAgentLogsRequest)(nil), // 26: inventory.v1.GetAgentLogsRequest + (*GetAgentLogsResponse)(nil), // 27: inventory.v1.GetAgentLogsResponse + (*AddAgentRequest)(nil), // 28: inventory.v1.AddAgentRequest + (*AddAgentResponse)(nil), // 29: inventory.v1.AddAgentResponse + (*ChangeAgentRequest)(nil), // 30: inventory.v1.ChangeAgentRequest + (*ChangeAgentResponse)(nil), // 31: inventory.v1.ChangeAgentResponse + (*AddPMMAgentParams)(nil), // 32: inventory.v1.AddPMMAgentParams + (*AddNodeExporterParams)(nil), // 33: inventory.v1.AddNodeExporterParams + (*ChangeNodeExporterParams)(nil), // 34: inventory.v1.ChangeNodeExporterParams + (*AddMySQLdExporterParams)(nil), // 35: inventory.v1.AddMySQLdExporterParams + (*ChangeMySQLdExporterParams)(nil), // 36: inventory.v1.ChangeMySQLdExporterParams + (*AddMongoDBExporterParams)(nil), // 37: inventory.v1.AddMongoDBExporterParams + (*ChangeMongoDBExporterParams)(nil), // 38: inventory.v1.ChangeMongoDBExporterParams + (*AddPostgresExporterParams)(nil), // 39: inventory.v1.AddPostgresExporterParams + (*ChangePostgresExporterParams)(nil), // 40: inventory.v1.ChangePostgresExporterParams + (*AddProxySQLExporterParams)(nil), // 41: inventory.v1.AddProxySQLExporterParams + (*ChangeProxySQLExporterParams)(nil), // 42: inventory.v1.ChangeProxySQLExporterParams + (*AddQANMySQLPerfSchemaAgentParams)(nil), // 43: inventory.v1.AddQANMySQLPerfSchemaAgentParams + (*ChangeQANMySQLPerfSchemaAgentParams)(nil), // 44: inventory.v1.ChangeQANMySQLPerfSchemaAgentParams + (*AddQANMySQLSlowlogAgentParams)(nil), // 45: inventory.v1.AddQANMySQLSlowlogAgentParams + (*ChangeQANMySQLSlowlogAgentParams)(nil), // 46: inventory.v1.ChangeQANMySQLSlowlogAgentParams + (*AddQANMongoDBProfilerAgentParams)(nil), // 47: inventory.v1.AddQANMongoDBProfilerAgentParams + (*ChangeQANMongoDBProfilerAgentParams)(nil), // 48: inventory.v1.ChangeQANMongoDBProfilerAgentParams + (*AddQANMongoDBMongologAgentParams)(nil), // 49: inventory.v1.AddQANMongoDBMongologAgentParams + (*ChangeQANMongoDBMongologAgentParams)(nil), // 50: inventory.v1.ChangeQANMongoDBMongologAgentParams + (*AddQANPostgreSQLPgStatementsAgentParams)(nil), // 51: inventory.v1.AddQANPostgreSQLPgStatementsAgentParams + (*ChangeQANPostgreSQLPgStatementsAgentParams)(nil), // 52: inventory.v1.ChangeQANPostgreSQLPgStatementsAgentParams + (*AddQANPostgreSQLPgStatMonitorAgentParams)(nil), // 53: inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams + (*ChangeQANPostgreSQLPgStatMonitorAgentParams)(nil), // 54: inventory.v1.ChangeQANPostgreSQLPgStatMonitorAgentParams + (*AddRDSExporterParams)(nil), // 55: inventory.v1.AddRDSExporterParams + (*ChangeRDSExporterParams)(nil), // 56: inventory.v1.ChangeRDSExporterParams + (*AddExternalExporterParams)(nil), // 57: inventory.v1.AddExternalExporterParams + (*ChangeExternalExporterParams)(nil), // 58: inventory.v1.ChangeExternalExporterParams + (*AddAzureDatabaseExporterParams)(nil), // 59: inventory.v1.AddAzureDatabaseExporterParams + (*ChangeAzureDatabaseExporterParams)(nil), // 60: inventory.v1.ChangeAzureDatabaseExporterParams + (*ChangeNomadAgentParams)(nil), // 61: inventory.v1.ChangeNomadAgentParams + (*AddValkeyExporterParams)(nil), // 62: inventory.v1.AddValkeyExporterParams + (*ChangeValkeyExporterParams)(nil), // 63: inventory.v1.ChangeValkeyExporterParams + (*AddRTAMongoDBAgentParams)(nil), // 64: inventory.v1.AddRTAMongoDBAgentParams + (*ChangeRTAMongoDBAgentParams)(nil), // 65: inventory.v1.ChangeRTAMongoDBAgentParams + (*RemoveAgentRequest)(nil), // 66: inventory.v1.RemoveAgentRequest + (*RemoveAgentResponse)(nil), // 67: inventory.v1.RemoveAgentResponse + nil, // 68: inventory.v1.PMMAgent.CustomLabelsEntry + nil, // 69: inventory.v1.NodeExporter.CustomLabelsEntry + nil, // 70: inventory.v1.MySQLdExporter.CustomLabelsEntry + nil, // 71: inventory.v1.MySQLdExporter.ExtraDsnParamsEntry + nil, // 72: inventory.v1.MongoDBExporter.CustomLabelsEntry + nil, // 73: inventory.v1.PostgresExporter.CustomLabelsEntry + nil, // 74: inventory.v1.ProxySQLExporter.CustomLabelsEntry + nil, // 75: inventory.v1.ValkeyExporter.CustomLabelsEntry + nil, // 76: inventory.v1.QANMySQLPerfSchemaAgent.CustomLabelsEntry + nil, // 77: inventory.v1.QANMySQLPerfSchemaAgent.ExtraDsnParamsEntry + nil, // 78: inventory.v1.QANMySQLSlowlogAgent.CustomLabelsEntry + nil, // 79: inventory.v1.QANMySQLSlowlogAgent.ExtraDsnParamsEntry + nil, // 80: inventory.v1.QANMongoDBProfilerAgent.CustomLabelsEntry + nil, // 81: inventory.v1.QANMongoDBMongologAgent.CustomLabelsEntry + nil, // 82: inventory.v1.RTAMongoDBAgent.CustomLabelsEntry + nil, // 83: inventory.v1.QANPostgreSQLPgStatementsAgent.CustomLabelsEntry + nil, // 84: inventory.v1.QANPostgreSQLPgStatMonitorAgent.CustomLabelsEntry + nil, // 85: inventory.v1.RDSExporter.CustomLabelsEntry + nil, // 86: inventory.v1.ExternalExporter.CustomLabelsEntry + nil, // 87: inventory.v1.AzureDatabaseExporter.CustomLabelsEntry + nil, // 88: inventory.v1.AddPMMAgentParams.CustomLabelsEntry + nil, // 89: inventory.v1.AddNodeExporterParams.CustomLabelsEntry + nil, // 90: inventory.v1.AddMySQLdExporterParams.CustomLabelsEntry + nil, // 91: inventory.v1.AddMySQLdExporterParams.ExtraDsnParamsEntry + nil, // 92: inventory.v1.AddMongoDBExporterParams.CustomLabelsEntry + nil, // 93: inventory.v1.AddPostgresExporterParams.CustomLabelsEntry + nil, // 94: inventory.v1.AddProxySQLExporterParams.CustomLabelsEntry + nil, // 95: inventory.v1.AddQANMySQLPerfSchemaAgentParams.CustomLabelsEntry + nil, // 96: inventory.v1.AddQANMySQLPerfSchemaAgentParams.ExtraDsnParamsEntry + nil, // 97: inventory.v1.AddQANMySQLSlowlogAgentParams.CustomLabelsEntry + nil, // 98: inventory.v1.AddQANMySQLSlowlogAgentParams.ExtraDsnParamsEntry + nil, // 99: inventory.v1.AddQANMongoDBProfilerAgentParams.CustomLabelsEntry + nil, // 100: inventory.v1.AddQANMongoDBMongologAgentParams.CustomLabelsEntry + nil, // 101: inventory.v1.AddQANPostgreSQLPgStatementsAgentParams.CustomLabelsEntry + nil, // 102: inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams.CustomLabelsEntry + nil, // 103: inventory.v1.AddRDSExporterParams.CustomLabelsEntry + nil, // 104: inventory.v1.AddExternalExporterParams.CustomLabelsEntry + nil, // 105: inventory.v1.AddAzureDatabaseExporterParams.CustomLabelsEntry + nil, // 106: inventory.v1.AddValkeyExporterParams.CustomLabelsEntry + nil, // 107: inventory.v1.AddRTAMongoDBAgentParams.CustomLabelsEntry + (AgentStatus)(0), // 108: inventory.v1.AgentStatus + (LogLevel)(0), // 109: inventory.v1.LogLevel + (*common.MetricsResolutions)(nil), // 110: common.MetricsResolutions + (*durationpb.Duration)(nil), // 111: google.protobuf.Duration + (*common.StringMap)(nil), // 112: common.StringMap + } +) + var file_inventory_v1_agents_proto_depIdxs = []int32{ 68, // 0: inventory.v1.PMMAgent.custom_labels:type_name -> inventory.v1.PMMAgent.CustomLabelsEntry 108, // 1: inventory.v1.VMAgent.status:type_name -> inventory.v1.AgentStatus diff --git a/api/inventory/v1/agents.pb.validate.go b/api/inventory/v1/agents.pb.validate.go index 0f2d68e9a5f..7e45f186227 100644 --- a/api/inventory/v1/agents.pb.validate.go +++ b/api/inventory/v1/agents.pb.validate.go @@ -2909,7 +2909,6 @@ func (m *ChangeCommonAgentParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -2938,7 +2937,6 @@ func (m *ChangeCommonAgentParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -8612,7 +8610,6 @@ func (m *ChangeNodeExporterParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -8641,7 +8638,6 @@ func (m *ChangeNodeExporterParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -8955,7 +8951,6 @@ func (m *ChangeMySQLdExporterParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -8984,7 +8979,6 @@ func (m *ChangeMySQLdExporterParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -9333,7 +9327,6 @@ func (m *ChangeMongoDBExporterParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -9362,7 +9355,6 @@ func (m *ChangeMongoDBExporterParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -9729,7 +9721,6 @@ func (m *ChangePostgresExporterParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -9758,7 +9749,6 @@ func (m *ChangePostgresExporterParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -10107,7 +10097,6 @@ func (m *ChangeProxySQLExporterParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -10136,7 +10125,6 @@ func (m *ChangeProxySQLExporterParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -10473,7 +10461,6 @@ func (m *ChangeQANMySQLPerfSchemaAgentParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -10502,7 +10489,6 @@ func (m *ChangeQANMySQLPerfSchemaAgentParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -10860,7 +10846,6 @@ func (m *ChangeQANMySQLSlowlogAgentParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -10889,7 +10874,6 @@ func (m *ChangeQANMySQLSlowlogAgentParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -11240,7 +11224,6 @@ func (m *ChangeQANMongoDBProfilerAgentParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -11269,7 +11252,6 @@ func (m *ChangeQANMongoDBProfilerAgentParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -11612,7 +11594,6 @@ func (m *ChangeQANMongoDBMongologAgentParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -11641,7 +11622,6 @@ func (m *ChangeQANMongoDBMongologAgentParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -11993,7 +11973,6 @@ func (m *ChangeQANPostgreSQLPgStatementsAgentParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -12022,7 +12001,6 @@ func (m *ChangeQANPostgreSQLPgStatementsAgentParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -12372,7 +12350,6 @@ func (m *ChangeQANPostgreSQLPgStatMonitorAgentParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -12401,7 +12378,6 @@ func (m *ChangeQANPostgreSQLPgStatMonitorAgentParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -12730,7 +12706,6 @@ func (m *ChangeRDSExporterParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -12759,7 +12734,6 @@ func (m *ChangeRDSExporterParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -13062,7 +13036,6 @@ func (m *ChangeExternalExporterParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -13091,7 +13064,6 @@ func (m *ChangeExternalExporterParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -13406,7 +13378,6 @@ func (m *ChangeAzureDatabaseExporterParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -13435,7 +13406,6 @@ func (m *ChangeAzureDatabaseExporterParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -13878,7 +13848,6 @@ func (m *ChangeValkeyExporterParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -13907,7 +13876,6 @@ func (m *ChangeValkeyExporterParams) validate(all bool) error { } } } - } if m.EnablePushMetrics != nil { @@ -13915,7 +13883,6 @@ func (m *ChangeValkeyExporterParams) validate(all bool) error { } if m.Username != nil { - if utf8.RuneCountInString(m.GetUsername()) < 1 { err := ChangeValkeyExporterParamsValidationError{ field: "Username", @@ -13926,7 +13893,6 @@ func (m *ChangeValkeyExporterParams) validate(all bool) error { } errors = append(errors, err) } - } if m.Password != nil { @@ -14247,7 +14213,6 @@ func (m *ChangeRTAMongoDBAgentParams) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -14276,7 +14241,6 @@ func (m *ChangeRTAMongoDBAgentParams) validate(all bool) error { } } } - } if m.LogLevel != nil { @@ -14316,7 +14280,6 @@ func (m *ChangeRTAMongoDBAgentParams) validate(all bool) error { } if m.RtaOptions != nil { - if all { switch v := interface{}(m.GetRtaOptions()).(type) { case interface{ ValidateAll() error }: @@ -14345,7 +14308,6 @@ func (m *ChangeRTAMongoDBAgentParams) validate(all bool) error { } } } - } if len(errors) > 0 { diff --git a/api/inventory/v1/agents.swagger.json b/api/inventory/v1/agents.swagger.json deleted file mode 100644 index 61bb3972d8d..00000000000 --- a/api/inventory/v1/agents.swagger.json +++ /dev/null @@ -1,4430 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "inventory/v1/agents.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "AgentsService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/inventory/agents": { - "get": { - "summary": "List Agents", - "description": "Returns a list of all Agents.", - "operationId": "ListAgents", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListAgentsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "pmm_agent_id", - "description": "Return only Agents started by this pmm-agent.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "node_id", - "description": "Return only Agents that provide insights for that Node.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "service_id", - "description": "Return only Agents that provide insights for that Service.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "agent_type", - "description": "Return only agents of a particular type.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "AGENT_TYPE_UNSPECIFIED", - "AGENT_TYPE_PMM_AGENT", - "AGENT_TYPE_VM_AGENT", - "AGENT_TYPE_NODE_EXPORTER", - "AGENT_TYPE_MYSQLD_EXPORTER", - "AGENT_TYPE_MONGODB_EXPORTER", - "AGENT_TYPE_POSTGRES_EXPORTER", - "AGENT_TYPE_PROXYSQL_EXPORTER", - "AGENT_TYPE_VALKEY_EXPORTER", - "AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT", - "AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT", - "AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT", - "AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT", - "AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT", - "AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT", - "AGENT_TYPE_EXTERNAL_EXPORTER", - "AGENT_TYPE_RDS_EXPORTER", - "AGENT_TYPE_AZURE_DATABASE_EXPORTER", - "AGENT_TYPE_NOMAD_AGENT", - "AGENT_TYPE_RTA_MONGODB_AGENT" - ], - "default": "AGENT_TYPE_UNSPECIFIED" - } - ], - "tags": [ - "AgentsService" - ] - }, - "post": { - "summary": "Add an Agent to Inventory", - "description": "Adds an Agent to Inventory. Only one agent at a time can be passed.", - "operationId": "AddAgent", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1AddAgentResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1AddAgentRequest" - } - } - ], - "tags": [ - "AgentsService" - ] - } - }, - "/v1/inventory/agents/{agent_id}": { - "get": { - "summary": "Get Agent", - "description": "Returns a single Agent by ID.", - "operationId": "GetAgent", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetAgentResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "agent_id", - "description": "Unique randomly generated instance identifier.", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "AgentsService" - ] - }, - "delete": { - "summary": "Remove an Agent from Inventory", - "description": "Removes an Agent from Inventory.", - "operationId": "RemoveAgent", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1RemoveAgentResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "force", - "description": "Remove agent with all dependencies.", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "tags": [ - "AgentsService" - ] - }, - "put": { - "summary": "Update an Agent in Inventory", - "description": "Updates an Agent in Inventory. Only one agent at a time can be passed.", - "operationId": "ChangeAgent", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ChangeAgentResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AgentsServiceChangeAgentBody" - } - } - ], - "tags": [ - "AgentsService" - ] - } - }, - "/v1/inventory/agents/{agent_id}/logs": { - "get": { - "summary": "Get Agent logs", - "description": "Returns Agent logs by ID.", - "operationId": "GetAgentLogs", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetAgentLogsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "agent_id", - "description": "Unique randomly generated instance identifier.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "limit", - "description": "Limit the number of log lines to this value. Pass 0 for no limit.", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "tags": [ - "AgentsService" - ] - } - } - }, - "definitions": { - "AgentsServiceChangeAgentBody": { - "type": "object", - "properties": { - "node_exporter": { - "$ref": "#/definitions/v1ChangeNodeExporterParams" - }, - "mysqld_exporter": { - "$ref": "#/definitions/v1ChangeMySQLdExporterParams" - }, - "mongodb_exporter": { - "$ref": "#/definitions/v1ChangeMongoDBExporterParams" - }, - "postgres_exporter": { - "$ref": "#/definitions/v1ChangePostgresExporterParams" - }, - "proxysql_exporter": { - "$ref": "#/definitions/v1ChangeProxySQLExporterParams" - }, - "external_exporter": { - "$ref": "#/definitions/v1ChangeExternalExporterParams" - }, - "rds_exporter": { - "$ref": "#/definitions/v1ChangeRDSExporterParams" - }, - "azure_database_exporter": { - "$ref": "#/definitions/v1ChangeAzureDatabaseExporterParams" - }, - "qan_mysql_perfschema_agent": { - "$ref": "#/definitions/v1ChangeQANMySQLPerfSchemaAgentParams" - }, - "qan_mysql_slowlog_agent": { - "$ref": "#/definitions/v1ChangeQANMySQLSlowlogAgentParams" - }, - "qan_mongodb_profiler_agent": { - "$ref": "#/definitions/v1ChangeQANMongoDBProfilerAgentParams" - }, - "qan_mongodb_mongolog_agent": { - "$ref": "#/definitions/v1ChangeQANMongoDBMongologAgentParams" - }, - "qan_postgresql_pgstatements_agent": { - "$ref": "#/definitions/v1ChangeQANPostgreSQLPgStatementsAgentParams" - }, - "qan_postgresql_pgstatmonitor_agent": { - "$ref": "#/definitions/v1ChangeQANPostgreSQLPgStatMonitorAgentParams" - }, - "nomad_agent": { - "$ref": "#/definitions/v1ChangeNomadAgentParams" - }, - "valkey_exporter": { - "$ref": "#/definitions/v1ChangeValkeyExporterParams" - }, - "rta_mongodb_agent": { - "$ref": "#/definitions/v1ChangeRTAMongoDBAgentParams" - } - } - }, - "commonMetricsResolutions": { - "type": "object", - "properties": { - "hr": { - "type": "string", - "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix." - }, - "mr": { - "type": "string", - "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix." - }, - "lr": { - "type": "string", - "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix." - } - }, - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions." - }, - "commonStringMap": { - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value." - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1AddAgentRequest": { - "type": "object", - "properties": { - "pmm_agent": { - "$ref": "#/definitions/v1AddPMMAgentParams" - }, - "node_exporter": { - "$ref": "#/definitions/v1AddNodeExporterParams" - }, - "mysqld_exporter": { - "$ref": "#/definitions/v1AddMySQLdExporterParams" - }, - "mongodb_exporter": { - "$ref": "#/definitions/v1AddMongoDBExporterParams" - }, - "postgres_exporter": { - "$ref": "#/definitions/v1AddPostgresExporterParams" - }, - "proxysql_exporter": { - "$ref": "#/definitions/v1AddProxySQLExporterParams" - }, - "external_exporter": { - "$ref": "#/definitions/v1AddExternalExporterParams" - }, - "rds_exporter": { - "$ref": "#/definitions/v1AddRDSExporterParams" - }, - "azure_database_exporter": { - "$ref": "#/definitions/v1AddAzureDatabaseExporterParams" - }, - "qan_mysql_perfschema_agent": { - "$ref": "#/definitions/v1AddQANMySQLPerfSchemaAgentParams" - }, - "qan_mysql_slowlog_agent": { - "$ref": "#/definitions/v1AddQANMySQLSlowlogAgentParams" - }, - "qan_mongodb_profiler_agent": { - "$ref": "#/definitions/v1AddQANMongoDBProfilerAgentParams" - }, - "qan_mongodb_mongolog_agent": { - "$ref": "#/definitions/v1AddQANMongoDBMongologAgentParams" - }, - "qan_postgresql_pgstatements_agent": { - "$ref": "#/definitions/v1AddQANPostgreSQLPgStatementsAgentParams" - }, - "qan_postgresql_pgstatmonitor_agent": { - "$ref": "#/definitions/v1AddQANPostgreSQLPgStatMonitorAgentParams" - }, - "valkey_exporter": { - "$ref": "#/definitions/v1AddValkeyExporterParams" - }, - "rta_mongodb_agent": { - "$ref": "#/definitions/v1AddRTAMongoDBAgentParams" - } - } - }, - "v1AddAgentResponse": { - "type": "object", - "properties": { - "pmm_agent": { - "$ref": "#/definitions/v1PMMAgent" - }, - "node_exporter": { - "$ref": "#/definitions/v1NodeExporter" - }, - "mysqld_exporter": { - "$ref": "#/definitions/v1MySQLdExporter" - }, - "mongodb_exporter": { - "$ref": "#/definitions/v1MongoDBExporter" - }, - "postgres_exporter": { - "$ref": "#/definitions/v1PostgresExporter" - }, - "proxysql_exporter": { - "$ref": "#/definitions/v1ProxySQLExporter" - }, - "external_exporter": { - "$ref": "#/definitions/v1ExternalExporter" - }, - "rds_exporter": { - "$ref": "#/definitions/v1RDSExporter" - }, - "azure_database_exporter": { - "$ref": "#/definitions/v1AzureDatabaseExporter" - }, - "qan_mysql_perfschema_agent": { - "$ref": "#/definitions/v1QANMySQLPerfSchemaAgent" - }, - "qan_mysql_slowlog_agent": { - "$ref": "#/definitions/v1QANMySQLSlowlogAgent" - }, - "qan_mongodb_profiler_agent": { - "$ref": "#/definitions/v1QANMongoDBProfilerAgent" - }, - "qan_mongodb_mongolog_agent": { - "$ref": "#/definitions/v1QANMongoDBMongologAgent" - }, - "qan_postgresql_pgstatements_agent": { - "$ref": "#/definitions/v1QANPostgreSQLPgStatementsAgent" - }, - "qan_postgresql_pgstatmonitor_agent": { - "$ref": "#/definitions/v1QANPostgreSQLPgStatMonitorAgent" - }, - "valkey_exporter": { - "$ref": "#/definitions/v1ValkeyExporter" - }, - "rta_mongodb_agent": { - "$ref": "#/definitions/v1RTAMongoDBAgent" - } - } - }, - "v1AddAzureDatabaseExporterParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "node_id": { - "type": "string", - "description": "Node identifier." - }, - "azure_client_id": { - "type": "string", - "title": "Azure client ID" - }, - "azure_client_secret": { - "type": "string", - "title": "Azure client secret" - }, - "azure_tenant_id": { - "type": "string", - "title": "Azure tanant ID" - }, - "azure_subscription_id": { - "type": "string", - "title": "Azure subscription ID" - }, - "azure_resource_group": { - "type": "string", - "description": "Azure resource group." - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure resource type (mysql, maria, postgres)" - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "push_metrics": { - "type": "boolean", - "description": "Enables push metrics mode for exporter." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - } - }, - "v1AddExternalExporterParams": { - "type": "object", - "properties": { - "runs_on_node_id": { - "type": "string", - "description": "The node identifier where this instance is run." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "HTTP basic auth username for collecting metrics." - }, - "password": { - "type": "string", - "description": "HTTP basic auth password for collecting metrics." - }, - "scheme": { - "type": "string", - "description": "Scheme to generate URI to exporter metrics endpoints(default: http)." - }, - "metrics_path": { - "type": "string", - "description": "Path under which metrics are exposed, used to generate URI(default: /metrics)." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "push_metrics": { - "type": "boolean", - "description": "Enables push metrics mode for exporter." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname verification." - } - } - }, - "v1AddMongoDBExporterParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MongoDB username for scraping metrics." - }, - "password": { - "type": "string", - "description": "MongoDB password for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_certificate_key": { - "type": "string", - "description": "Client certificate and key." - }, - "tls_certificate_key_file_password": { - "type": "string", - "description": "Password for decrypting tls_certificate_key." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "push_metrics": { - "type": "boolean", - "description": "Enables push metrics mode for exporter." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "authentication_mechanism": { - "type": "string", - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details." - }, - "authentication_database": { - "type": "string", - "description": "Authentication database." - }, - "agent_password": { - "type": "string", - "description": "Custom password for exporter endpoint /metrics." - }, - "stats_collections": { - "type": "array", - "items": { - "type": "string" - }, - "title": "List of colletions to get stats from. Can use *" - }, - "collections_limit": { - "type": "integer", - "format": "int32", - "title": "Collections limit. Only get Databases and collection stats if the total number of collections in the server\nis less than this value. 0: no limit" - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "environment_variable_names": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Environment variable names to pass to the exporter.\nValues will be resolved from pmm-agent's environment when starting the exporter." - }, - "enable_all_collectors": { - "type": "boolean", - "description": "Enable all collectors." - } - } - }, - "v1AddMySQLdExporterParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MySQL username for scraping metrics." - }, - "password": { - "type": "string", - "description": "MySQL password for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "tls_cert": { - "type": "string", - "description": "Client certificate." - }, - "tls_key": { - "type": "string", - "description": "Password for decrypting tls_cert." - }, - "tablestats_group_table_limit": { - "type": "integer", - "format": "int32", - "description": "Tablestats group collectors will be disabled if there are more than that number of tables.\n0 means tablestats group collectors are always enabled (no limit).\nNegative value means tablestats group collectors are always disabled." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "push_metrics": { - "type": "boolean", - "description": "Enables push metrics mode for exporter." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "agent_password": { - "type": "string", - "description": "Custom password for exporter endpoint /metrics." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra DSN parameters for MySQL connection." - } - } - }, - "v1AddNodeExporterParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "push_metrics": { - "type": "boolean", - "description": "Enables push metrics mode for exporter." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "title": "Expose the node_exporter process on all public interfaces" - } - } - }, - "v1AddPMMAgentParams": { - "type": "object", - "properties": { - "runs_on_node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - } - }, - "v1AddPostgresExporterParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "PostgreSQL username for scraping metrics." - }, - "password": { - "type": "string", - "description": "PostgreSQL password for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "push_metrics": { - "type": "boolean", - "description": "Enables push metrics mode for exporter." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "tls_ca": { - "type": "string", - "description": "TLS CA certificate." - }, - "tls_cert": { - "type": "string", - "description": "TLS Certifcate." - }, - "tls_key": { - "type": "string", - "description": "TLS Certificate Key." - }, - "agent_password": { - "type": "string", - "description": "Custom password for exporter endpoint /metrics." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "auto_discovery_limit": { - "type": "integer", - "format": "int32", - "description": "Limit of databases for auto-discovery." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "max_exporter_connections": { - "type": "integer", - "format": "int32", - "description": "Maximum number of connections that exporter can open to the database instance." - } - } - }, - "v1AddProxySQLExporterParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "ProxySQL username for scraping metrics." - }, - "password": { - "type": "string", - "description": "ProxySQL password for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "push_metrics": { - "type": "boolean", - "description": "Enables push metrics mode for exporter." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "agent_password": { - "type": "string", - "description": "Custom password for exporter endpoint /metrics." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - } - } - }, - "v1AddQANMongoDBMongologAgentParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MongoDB username for getting profile data." - }, - "password": { - "type": "string", - "description": "MongoDB password for getting profile data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_certificate_key": { - "type": "string", - "description": "Client certificate and key." - }, - "tls_certificate_key_file_password": { - "type": "string", - "description": "Password for decrypting tls_certificate_key." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "authentication_mechanism": { - "type": "string", - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details." - }, - "authentication_database": { - "type": "string", - "description": "Authentication database." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for agent." - } - } - }, - "v1AddQANMongoDBProfilerAgentParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MongoDB username for getting profile data." - }, - "password": { - "type": "string", - "description": "MongoDB password for getting profile data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_certificate_key": { - "type": "string", - "description": "Client certificate and key." - }, - "tls_certificate_key_file_password": { - "type": "string", - "description": "Password for decrypting tls_certificate_key." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "authentication_mechanism": { - "type": "string", - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details." - }, - "authentication_database": { - "type": "string", - "description": "Authentication database." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for agent." - } - } - }, - "v1AddQANMySQLPerfSchemaAgentParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MySQL username for getting performance data." - }, - "password": { - "type": "string", - "description": "MySQL password for getting performance data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "tls_cert": { - "type": "string", - "description": "Client certificate." - }, - "tls_key": { - "type": "string", - "description": "Password for decrypting tls_cert." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "disable_query_examples": { - "type": "boolean", - "description": "Disable query examples." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra DSN parameters for MySQL connection." - } - } - }, - "v1AddQANMySQLSlowlogAgentParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MySQL username for getting slowlog data." - }, - "password": { - "type": "string", - "description": "MySQL password for getting slowlog data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "tls_cert": { - "type": "string", - "description": "Client certificate." - }, - "tls_key": { - "type": "string", - "description": "Password for decrypting tls_cert." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "disable_query_examples": { - "type": "boolean", - "description": "Disable query examples." - }, - "max_slowlog_file_size": { - "type": "string", - "format": "int64", - "description": "Rotate slowlog file at this size if \u003e 0.\nUse zero or negative value to disable rotation." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra DSN parameters for MySQL connection." - } - } - }, - "v1AddQANPostgreSQLPgStatMonitorAgentParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "PostgreSQL username for getting pg stat monitor data." - }, - "password": { - "type": "string", - "description": "PostgreSQL password for getting pg stat monitor data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "disable_query_examples": { - "type": "boolean", - "description": "Disable query examples." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "tls_ca": { - "type": "string", - "description": "TLS CA certificate." - }, - "tls_cert": { - "type": "string", - "description": "TLS Certifcate." - }, - "tls_key": { - "type": "string", - "description": "TLS Certificate Key." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - } - }, - "v1AddQANPostgreSQLPgStatementsAgentParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "PostgreSQL username for getting pg stat statements data." - }, - "password": { - "type": "string", - "description": "PostgreSQL password for getting pg stat statements data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "tls_ca": { - "type": "string", - "description": "TLS CA certificate." - }, - "tls_cert": { - "type": "string", - "description": "TLS Certifcate." - }, - "tls_key": { - "type": "string", - "description": "TLS Certificate Key." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - } - }, - "v1AddRDSExporterParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "node_id": { - "type": "string", - "description": "Node identifier." - }, - "aws_access_key": { - "type": "string", - "description": "AWS Access Key." - }, - "aws_secret_key": { - "type": "string", - "description": "AWS Secret Key." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "disable_basic_metrics": { - "type": "boolean", - "description": "Disable basic metrics." - }, - "disable_enhanced_metrics": { - "type": "boolean", - "description": "Disable enhanced metrics." - }, - "push_metrics": { - "type": "boolean", - "description": "Enables push metrics mode for exporter." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - } - }, - "v1AddRTAMongoDBAgentParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MongoDB username for getting queries data." - }, - "password": { - "type": "string", - "description": "MongoDB password for getting queries data." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for agent." - }, - "tls": { - "type": "boolean", - "description": "MongoDB specific options.\nUse TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_certificate_key": { - "type": "string", - "description": "Client certificate and key." - }, - "tls_certificate_key_file_password": { - "type": "string", - "description": "Password for decrypting tls_certificate_key." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "authentication_mechanism": { - "type": "string", - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details." - }, - "rta_options": { - "$ref": "#/definitions/v1RTAOptions", - "description": "Real-Time Analytics options." - } - } - }, - "v1AddValkeyExporterParams": { - "type": "object", - "properties": { - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "Valkey username for scraping metrics." - }, - "password": { - "type": "string", - "description": "Valkey password for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "push_metrics": { - "type": "boolean", - "description": "Enables push metrics mode for exporter." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "tls_ca": { - "type": "string", - "description": "TLS CA certificate." - }, - "tls_cert": { - "type": "string", - "description": "TLS Certifcate." - }, - "tls_key": { - "type": "string", - "description": "TLS Certificate Key." - }, - "agent_password": { - "type": "string", - "description": "Custom password for exporter endpoint /metrics." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - } - }, - "v1AgentStatus": { - "type": "string", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "default": "AGENT_STATUS_UNSPECIFIED", - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state." - }, - "v1AgentType": { - "type": "string", - "enum": [ - "AGENT_TYPE_UNSPECIFIED", - "AGENT_TYPE_PMM_AGENT", - "AGENT_TYPE_VM_AGENT", - "AGENT_TYPE_NODE_EXPORTER", - "AGENT_TYPE_MYSQLD_EXPORTER", - "AGENT_TYPE_MONGODB_EXPORTER", - "AGENT_TYPE_POSTGRES_EXPORTER", - "AGENT_TYPE_PROXYSQL_EXPORTER", - "AGENT_TYPE_VALKEY_EXPORTER", - "AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT", - "AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT", - "AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT", - "AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT", - "AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT", - "AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT", - "AGENT_TYPE_EXTERNAL_EXPORTER", - "AGENT_TYPE_RDS_EXPORTER", - "AGENT_TYPE_AZURE_DATABASE_EXPORTER", - "AGENT_TYPE_NOMAD_AGENT", - "AGENT_TYPE_RTA_MONGODB_AGENT" - ], - "default": "AGENT_TYPE_UNSPECIFIED", - "description": "AgentType describes supported Agent types." - }, - "v1AzureDatabaseExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "node_id": { - "type": "string", - "description": "Node identifier." - }, - "azure_database_subscription_id": { - "type": "string", - "description": "Azure database subscription ID." - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure database resource type (mysql, maria, postgres)" - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status (the same for several configurations)." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics (the same for several configurations)." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if the exporter operates in push metrics mode." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - } - }, - "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure Node metrics." - }, - "v1ChangeAgentResponse": { - "type": "object", - "properties": { - "node_exporter": { - "$ref": "#/definitions/v1NodeExporter" - }, - "mysqld_exporter": { - "$ref": "#/definitions/v1MySQLdExporter" - }, - "mongodb_exporter": { - "$ref": "#/definitions/v1MongoDBExporter" - }, - "postgres_exporter": { - "$ref": "#/definitions/v1PostgresExporter" - }, - "proxysql_exporter": { - "$ref": "#/definitions/v1ProxySQLExporter" - }, - "external_exporter": { - "$ref": "#/definitions/v1ExternalExporter" - }, - "rds_exporter": { - "$ref": "#/definitions/v1RDSExporter" - }, - "azure_database_exporter": { - "$ref": "#/definitions/v1AzureDatabaseExporter" - }, - "qan_mysql_perfschema_agent": { - "$ref": "#/definitions/v1QANMySQLPerfSchemaAgent" - }, - "qan_mysql_slowlog_agent": { - "$ref": "#/definitions/v1QANMySQLSlowlogAgent" - }, - "qan_mongodb_profiler_agent": { - "$ref": "#/definitions/v1QANMongoDBProfilerAgent" - }, - "qan_mongodb_mongolog_agent": { - "$ref": "#/definitions/v1QANMongoDBMongologAgent" - }, - "qan_postgresql_pgstatements_agent": { - "$ref": "#/definitions/v1QANPostgreSQLPgStatementsAgent" - }, - "qan_postgresql_pgstatmonitor_agent": { - "$ref": "#/definitions/v1QANPostgreSQLPgStatMonitorAgent" - }, - "nomad_agent": { - "$ref": "#/definitions/v1NomadAgent" - }, - "valkey_exporter": { - "$ref": "#/definitions/v1ValkeyExporter" - }, - "rta_mongodb_agent": { - "$ref": "#/definitions/v1RTAMongoDBAgent" - } - } - }, - "v1ChangeAzureDatabaseExporterParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "azure_client_id": { - "type": "string", - "x-nullable": true, - "title": "Azure client ID" - }, - "azure_client_secret": { - "type": "string", - "x-nullable": true, - "title": "Azure client secret" - }, - "azure_tenant_id": { - "type": "string", - "x-nullable": true, - "title": "Azure tenant ID" - }, - "azure_subscription_id": { - "type": "string", - "x-nullable": true, - "title": "Azure subscription ID" - }, - "azure_resource_group": { - "type": "string", - "x-nullable": true, - "description": "Azure resource group." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - } - } - }, - "v1ChangeExternalExporterParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "username": { - "type": "string", - "x-nullable": true, - "description": "HTTP basic auth username for collecting metrics." - }, - "scheme": { - "type": "string", - "x-nullable": true, - "description": "Scheme to generate URI to exporter metrics endpoints." - }, - "metrics_path": { - "type": "string", - "x-nullable": true, - "description": "Path under which metrics are exposed, used to generate URI." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "description": "Listen port for scraping metrics." - } - } - }, - "v1ChangeMongoDBExporterParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "username": { - "type": "string", - "x-nullable": true, - "description": "MongoDB username for scraping metrics." - }, - "password": { - "type": "string", - "x-nullable": true, - "description": "MongoDB password for scraping metrics." - }, - "tls": { - "type": "boolean", - "x-nullable": true, - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "x-nullable": true, - "description": "Skip TLS certificate and hostname validation." - }, - "tls_certificate_key": { - "type": "string", - "x-nullable": true, - "description": "Client certificate and key." - }, - "tls_certificate_key_file_password": { - "type": "string", - "x-nullable": true, - "description": "Password for decrypting tls_certificate_key." - }, - "tls_ca": { - "type": "string", - "x-nullable": true, - "description": "Certificate Authority certificate chain." - }, - "skip_connection_check": { - "type": "boolean", - "x-nullable": true, - "description": "Skip connection check." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "authentication_mechanism": { - "type": "string", - "x-nullable": true, - "description": "Authentication mechanism." - }, - "authentication_database": { - "type": "string", - "x-nullable": true, - "description": "Authentication database." - }, - "agent_password": { - "type": "string", - "x-nullable": true, - "description": "Custom password for exporter endpoint /metrics." - }, - "stats_collections": { - "type": "array", - "items": { - "type": "string" - }, - "title": "List of collections to get stats from. Can use *" - }, - "collections_limit": { - "type": "integer", - "format": "int32", - "x-nullable": true, - "title": "Collections limit. Only get Databases and collection stats if the total number of collections in the server is less than this value. 0: no limit" - }, - "enable_all_collectors": { - "type": "boolean", - "x-nullable": true, - "description": "Enable all collectors." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "x-nullable": true, - "description": "Optionally expose the exporter process on all public interfaces." - } - } - }, - "v1ChangeMySQLdExporterParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "username": { - "type": "string", - "x-nullable": true, - "description": "MySQL username for scraping metrics." - }, - "password": { - "type": "string", - "x-nullable": true, - "description": "MySQL password for scraping metrics." - }, - "tls": { - "type": "boolean", - "x-nullable": true, - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "x-nullable": true, - "description": "Skip TLS certificate and hostname validation." - }, - "tls_ca": { - "type": "string", - "x-nullable": true, - "description": "Certificate Authority certificate chain." - }, - "tls_cert": { - "type": "string", - "x-nullable": true, - "description": "Client certificate." - }, - "tls_key": { - "type": "string", - "x-nullable": true, - "description": "Password for decrypting tls_cert." - }, - "tablestats_group_table_limit": { - "type": "integer", - "format": "int32", - "x-nullable": true, - "description": "Tablestats group collectors will be disabled if there are more than that number of tables." - }, - "skip_connection_check": { - "type": "boolean", - "x-nullable": true, - "description": "Skip connection check." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "agent_password": { - "type": "string", - "x-nullable": true, - "description": "Custom password for exporter endpoint /metrics." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "x-nullable": true, - "description": "Optionally expose the exporter process on all public interfaces." - } - } - }, - "v1ChangeNodeExporterParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "x-nullable": true, - "description": "Expose the node_exporter process on all public interfaces." - } - } - }, - "v1ChangeNomadAgentParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - } - } - }, - "v1ChangePostgresExporterParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "username": { - "type": "string", - "x-nullable": true, - "description": "PostgreSQL username for scraping metrics." - }, - "password": { - "type": "string", - "x-nullable": true, - "description": "PostgreSQL password for scraping metrics." - }, - "tls": { - "type": "boolean", - "x-nullable": true, - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "x-nullable": true, - "description": "Skip TLS certificate and hostname validation." - }, - "skip_connection_check": { - "type": "boolean", - "x-nullable": true, - "description": "Skip connection check." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "tls_ca": { - "type": "string", - "x-nullable": true, - "description": "TLS CA certificate." - }, - "tls_cert": { - "type": "string", - "x-nullable": true, - "description": "TLS Certificate." - }, - "tls_key": { - "type": "string", - "x-nullable": true, - "description": "TLS Certificate Key." - }, - "agent_password": { - "type": "string", - "x-nullable": true, - "description": "Custom password for exporter endpoint /metrics." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - }, - "auto_discovery_limit": { - "type": "integer", - "format": "int32", - "x-nullable": true, - "description": "Limit of databases for auto-discovery." - }, - "expose_exporter": { - "type": "boolean", - "x-nullable": true, - "description": "Optionally expose the exporter process on all public interfaces." - }, - "max_exporter_connections": { - "type": "integer", - "format": "int32", - "x-nullable": true, - "description": "Maximum number of connections that exporter can open to the database instance." - } - } - }, - "v1ChangeProxySQLExporterParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "username": { - "type": "string", - "x-nullable": true, - "description": "ProxySQL username for scraping metrics." - }, - "password": { - "type": "string", - "x-nullable": true, - "description": "ProxySQL password for scraping metrics." - }, - "tls": { - "type": "boolean", - "x-nullable": true, - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "x-nullable": true, - "description": "Skip TLS certificate and hostname validation." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "agent_password": { - "type": "string", - "x-nullable": true, - "description": "Custom password for exporter endpoint /metrics." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "x-nullable": true, - "description": "Optionally expose the exporter process on all public interfaces." - } - } - }, - "v1ChangeQANMongoDBMongologAgentParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "username": { - "type": "string", - "x-nullable": true, - "description": "MongoDB username for getting mongolog data." - }, - "password": { - "type": "string", - "x-nullable": true, - "description": "MongoDB password for getting mongolog data." - }, - "tls": { - "type": "boolean", - "x-nullable": true, - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "x-nullable": true, - "description": "Skip TLS certificate and hostname validation." - }, - "tls_certificate_key": { - "type": "string", - "x-nullable": true, - "description": "Client certificate and key." - }, - "tls_certificate_key_file_password": { - "type": "string", - "x-nullable": true, - "description": "Password for decrypting tls_certificate_key." - }, - "tls_ca": { - "type": "string", - "x-nullable": true, - "description": "Certificate Authority certificate chain." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "x-nullable": true, - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "authentication_mechanism": { - "type": "string", - "x-nullable": true, - "description": "Authentication mechanism." - }, - "authentication_database": { - "type": "string", - "x-nullable": true, - "description": "Authentication database." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - } - } - }, - "v1ChangeQANMongoDBProfilerAgentParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "username": { - "type": "string", - "x-nullable": true, - "description": "MongoDB username for getting profile data." - }, - "password": { - "type": "string", - "x-nullable": true, - "description": "MongoDB password for getting profile data." - }, - "tls": { - "type": "boolean", - "x-nullable": true, - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "x-nullable": true, - "description": "Skip TLS certificate and hostname validation." - }, - "tls_certificate_key": { - "type": "string", - "x-nullable": true, - "description": "Client certificate and key." - }, - "tls_certificate_key_file_password": { - "type": "string", - "x-nullable": true, - "description": "Password for decrypting tls_certificate_key." - }, - "tls_ca": { - "type": "string", - "x-nullable": true, - "description": "Certificate Authority certificate chain." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "x-nullable": true, - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "authentication_mechanism": { - "type": "string", - "x-nullable": true, - "description": "Authentication mechanism." - }, - "authentication_database": { - "type": "string", - "x-nullable": true, - "description": "Authentication database." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - } - } - }, - "v1ChangeQANMySQLPerfSchemaAgentParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "username": { - "type": "string", - "x-nullable": true, - "description": "MySQL username for getting performance data." - }, - "password": { - "type": "string", - "x-nullable": true, - "description": "MySQL password for getting performance data." - }, - "tls": { - "type": "boolean", - "x-nullable": true, - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "x-nullable": true, - "description": "Skip TLS certificate and hostname validation." - }, - "tls_ca": { - "type": "string", - "x-nullable": true, - "description": "Certificate Authority certificate chain." - }, - "tls_cert": { - "type": "string", - "x-nullable": true, - "description": "Client certificate." - }, - "tls_key": { - "type": "string", - "x-nullable": true, - "description": "Password for decrypting tls_cert." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "x-nullable": true, - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "disable_query_examples": { - "type": "boolean", - "x-nullable": true, - "description": "Disable query examples." - }, - "skip_connection_check": { - "type": "boolean", - "x-nullable": true, - "description": "Skip connection check." - }, - "disable_comments_parsing": { - "type": "boolean", - "x-nullable": true, - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - } - } - }, - "v1ChangeQANMySQLSlowlogAgentParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "username": { - "type": "string", - "x-nullable": true, - "description": "MySQL username for getting slowlog data." - }, - "password": { - "type": "string", - "x-nullable": true, - "description": "MySQL password for getting slowlog data." - }, - "tls": { - "type": "boolean", - "x-nullable": true, - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "x-nullable": true, - "description": "Skip TLS certificate and hostname validation." - }, - "tls_ca": { - "type": "string", - "x-nullable": true, - "description": "Certificate Authority certificate chain." - }, - "tls_cert": { - "type": "string", - "x-nullable": true, - "description": "Client certificate." - }, - "tls_key": { - "type": "string", - "x-nullable": true, - "description": "Password for decrypting tls_cert." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "x-nullable": true, - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "disable_query_examples": { - "type": "boolean", - "x-nullable": true, - "description": "Disable query examples." - }, - "max_slowlog_file_size": { - "type": "string", - "format": "int64", - "x-nullable": true, - "description": "Rotate slowlog file at this size if \u003e 0." - }, - "skip_connection_check": { - "type": "boolean", - "x-nullable": true, - "description": "Skip connection check." - }, - "disable_comments_parsing": { - "type": "boolean", - "x-nullable": true, - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - } - } - }, - "v1ChangeQANPostgreSQLPgStatMonitorAgentParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "username": { - "type": "string", - "x-nullable": true, - "description": "PostgreSQL username for getting pg stat monitor data." - }, - "password": { - "type": "string", - "x-nullable": true, - "description": "PostgreSQL password for getting pg stat monitor data." - }, - "tls": { - "type": "boolean", - "x-nullable": true, - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "x-nullable": true, - "description": "Skip TLS certificate and hostname validation." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "x-nullable": true, - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "disable_query_examples": { - "type": "boolean", - "x-nullable": true, - "description": "Disable query examples." - }, - "disable_comments_parsing": { - "type": "boolean", - "x-nullable": true, - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "tls_ca": { - "type": "string", - "x-nullable": true, - "description": "TLS CA certificate." - }, - "tls_cert": { - "type": "string", - "x-nullable": true, - "description": "TLS Certificate." - }, - "tls_key": { - "type": "string", - "x-nullable": true, - "description": "TLS Certificate Key." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - } - } - }, - "v1ChangeQANPostgreSQLPgStatementsAgentParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "username": { - "type": "string", - "x-nullable": true, - "description": "PostgreSQL username for getting pg stat statements data." - }, - "password": { - "type": "string", - "x-nullable": true, - "description": "PostgreSQL password for getting pg stat statements data." - }, - "tls": { - "type": "boolean", - "x-nullable": true, - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "x-nullable": true, - "description": "Skip TLS certificate and hostname validation." - }, - "disable_comments_parsing": { - "type": "boolean", - "x-nullable": true, - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "x-nullable": true, - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "tls_ca": { - "type": "string", - "x-nullable": true, - "description": "TLS CA certificate." - }, - "tls_cert": { - "type": "string", - "x-nullable": true, - "description": "TLS Certificate." - }, - "tls_key": { - "type": "string", - "x-nullable": true, - "description": "TLS Certificate Key." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - } - } - }, - "v1ChangeRDSExporterParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "aws_access_key": { - "type": "string", - "x-nullable": true, - "description": "AWS Access Key." - }, - "aws_secret_key": { - "type": "string", - "x-nullable": true, - "description": "AWS Secret Key." - }, - "disable_basic_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Disable basic metrics." - }, - "disable_enhanced_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Disable enhanced metrics." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - } - } - }, - "v1ChangeRTAMongoDBAgentParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - }, - "username": { - "type": "string", - "x-nullable": true, - "description": "MongoDB username for getting profile data." - }, - "password": { - "type": "string", - "x-nullable": true, - "description": "MongoDB password for getting profile data." - }, - "tls": { - "type": "boolean", - "x-nullable": true, - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "x-nullable": true, - "description": "Skip TLS certificate and hostname validation." - }, - "tls_certificate_key": { - "type": "string", - "x-nullable": true, - "description": "Client certificate and key." - }, - "tls_certificate_key_file_password": { - "type": "string", - "x-nullable": true, - "description": "Password for decrypting tls_certificate_key." - }, - "tls_ca": { - "type": "string", - "x-nullable": true, - "description": "Certificate Authority certificate chain." - }, - "authentication_mechanism": { - "type": "string", - "x-nullable": true, - "description": "Authentication mechanism." - }, - "rta_options": { - "$ref": "#/definitions/v1RTAOptions", - "x-nullable": true, - "description": "Real-Time Analytics options." - } - } - }, - "v1ChangeValkeyExporterParams": { - "type": "object", - "properties": { - "enable": { - "type": "boolean", - "x-nullable": true, - "description": "Enable this Agent. Agents are enabled by default when they get added." - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - }, - "enable_push_metrics": { - "type": "boolean", - "x-nullable": true, - "description": "Enables push metrics with vmagent." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "username": { - "type": "string", - "x-nullable": true, - "description": "Valkey username for scraping metrics." - }, - "password": { - "type": "string", - "x-nullable": true, - "description": "Valkey password for scraping metrics." - }, - "tls": { - "type": "boolean", - "x-nullable": true, - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "x-nullable": true, - "description": "Skip TLS certificate and hostname validation." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "tls_ca": { - "type": "string", - "x-nullable": true, - "description": "TLS CA certificate." - }, - "tls_cert": { - "type": "string", - "x-nullable": true, - "description": "TLS Certifcate." - }, - "tls_key": { - "type": "string", - "x-nullable": true, - "description": "TLS Certificate Key." - }, - "agent_password": { - "type": "string", - "x-nullable": true, - "description": "Custom password for exporter endpoint /metrics." - }, - "expose_exporter": { - "type": "boolean", - "x-nullable": true, - "title": "Optionally expose the exporter process on all public interfaces" - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "x-nullable": true, - "description": "Log level for exporter." - } - } - }, - "v1ExternalExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "runs_on_node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "disabled": { - "type": "boolean", - "description": "If disabled, metrics from this exporter will not be collected." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "HTTP basic auth username for collecting metrics." - }, - "scheme": { - "type": "string", - "description": "Scheme to generate URI to exporter metrics endpoints." - }, - "metrics_path": { - "type": "string", - "description": "Path under which metrics are exposed, used to generate URI." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname verification." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - } - }, - "description": "ExternalExporter runs on any Node type, including Remote Node." - }, - "v1GetAgentLogsResponse": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "type": "string" - } - }, - "agent_config_log_lines_count": { - "type": "integer", - "format": "int64" - } - } - }, - "v1GetAgentResponse": { - "type": "object", - "properties": { - "pmm_agent": { - "$ref": "#/definitions/v1PMMAgent" - }, - "vmagent": { - "$ref": "#/definitions/v1VMAgent" - }, - "node_exporter": { - "$ref": "#/definitions/v1NodeExporter" - }, - "mysqld_exporter": { - "$ref": "#/definitions/v1MySQLdExporter" - }, - "mongodb_exporter": { - "$ref": "#/definitions/v1MongoDBExporter" - }, - "postgres_exporter": { - "$ref": "#/definitions/v1PostgresExporter" - }, - "proxysql_exporter": { - "$ref": "#/definitions/v1ProxySQLExporter" - }, - "qan_mysql_perfschema_agent": { - "$ref": "#/definitions/v1QANMySQLPerfSchemaAgent" - }, - "qan_mysql_slowlog_agent": { - "$ref": "#/definitions/v1QANMySQLSlowlogAgent" - }, - "qan_mongodb_profiler_agent": { - "$ref": "#/definitions/v1QANMongoDBProfilerAgent" - }, - "qan_mongodb_mongolog_agent": { - "$ref": "#/definitions/v1QANMongoDBMongologAgent" - }, - "qan_postgresql_pgstatements_agent": { - "$ref": "#/definitions/v1QANPostgreSQLPgStatementsAgent" - }, - "qan_postgresql_pgstatmonitor_agent": { - "$ref": "#/definitions/v1QANPostgreSQLPgStatMonitorAgent" - }, - "external_exporter": { - "$ref": "#/definitions/v1ExternalExporter" - }, - "rds_exporter": { - "$ref": "#/definitions/v1RDSExporter" - }, - "azure_database_exporter": { - "$ref": "#/definitions/v1AzureDatabaseExporter" - }, - "nomad_agent": { - "$ref": "#/definitions/v1NomadAgent" - }, - "valkey_exporter": { - "$ref": "#/definitions/v1ValkeyExporter" - }, - "rta_mongodb_agent": { - "$ref": "#/definitions/v1RTAMongoDBAgent" - } - } - }, - "v1ListAgentsResponse": { - "type": "object", - "properties": { - "pmm_agent": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1PMMAgent" - } - }, - "vm_agent": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1VMAgent" - } - }, - "node_exporter": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1NodeExporter" - } - }, - "mysqld_exporter": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1MySQLdExporter" - } - }, - "mongodb_exporter": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1MongoDBExporter" - } - }, - "postgres_exporter": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1PostgresExporter" - } - }, - "proxysql_exporter": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1ProxySQLExporter" - } - }, - "qan_mysql_perfschema_agent": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1QANMySQLPerfSchemaAgent" - } - }, - "qan_mysql_slowlog_agent": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1QANMySQLSlowlogAgent" - } - }, - "qan_mongodb_profiler_agent": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1QANMongoDBProfilerAgent" - } - }, - "qan_mongodb_mongolog_agent": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1QANMongoDBMongologAgent" - } - }, - "qan_postgresql_pgstatements_agent": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1QANPostgreSQLPgStatementsAgent" - } - }, - "qan_postgresql_pgstatmonitor_agent": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1QANPostgreSQLPgStatMonitorAgent" - } - }, - "external_exporter": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1ExternalExporter" - } - }, - "rds_exporter": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1RDSExporter" - } - }, - "azure_database_exporter": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1AzureDatabaseExporter" - } - }, - "nomad_agent": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1NomadAgent" - } - }, - "valkey_exporter": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1ValkeyExporter" - } - }, - "rta_mongodb_agent": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1RTAMongoDBAgent" - } - } - } - }, - "v1LogLevel": { - "type": "string", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "default": "LOG_LEVEL_UNSPECIFIED", - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "title": "Log level for exporters" - }, - "v1MongoDBExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MongoDB username for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "disabled_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of disabled collector names." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "stats_collections": { - "type": "array", - "items": { - "type": "string" - }, - "title": "List of colletions to get stats from. Can use *" - }, - "collections_limit": { - "type": "integer", - "format": "int32", - "title": "Collections limit. Only get Databases and collection stats if the total number of collections in the server\nis less than this value. 0: no limit" - }, - "enable_all_collectors": { - "type": "boolean", - "description": "Enable all collectors." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "environment_variable_names": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Environment variable names passed to the exporter." - } - }, - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics." - }, - "v1MySQLdExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MySQL username for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "tls_cert": { - "type": "string", - "description": "Client certificate." - }, - "tls_key": { - "type": "string", - "description": "Password for decrypting tls_cert." - }, - "tablestats_group_table_limit": { - "type": "integer", - "format": "int32", - "description": "Tablestats group collectors are disabled if there are more than that number of tables.\n0 means tablestats group collectors are always enabled (no limit).\nNegative value means tablestats group collectors are always disabled." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "disabled_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of disabled collector names." - }, - "table_count": { - "type": "integer", - "format": "int32", - "description": "Actual table count at the moment of adding." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "tablestats_group_disabled": { - "type": "boolean", - "description": "True if tablestats group collectors are currently disabled." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra DSN parameters for MySQL connection." - } - }, - "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics." - }, - "v1NodeExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "disabled_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of disabled collector names." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - } - }, - "description": "NodeExporter runs on Generic or Container Node and exposes its metrics." - }, - "v1NomadAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - } - } - }, - "v1PMMAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "runs_on_node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "connected": { - "type": "boolean", - "description": "True if Agent is running and connected to pmm-managed." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - } - }, - "description": "PMMAgent runs on Generic or Container Node." - }, - "v1PostgresExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "PostgreSQL username for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "disabled_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of disabled collector names." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "auto_discovery_limit": { - "type": "integer", - "format": "int32", - "description": "Limit of databases for auto-discovery." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "max_exporter_connections": { - "type": "integer", - "format": "int32", - "description": "Maximum number of connections that exporter can open to the database instance." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - } - }, - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics." - }, - "v1ProxySQLExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "ProxySQL username for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "disabled_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of disabled collector names." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - } - }, - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics." - }, - "v1QANMongoDBMongologAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MongoDB username for getting profiler data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - }, - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server." - }, - "v1QANMongoDBProfilerAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MongoDB username for getting profiler data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - }, - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server." - }, - "v1QANMySQLPerfSchemaAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MySQL username for getting performance data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "tls_cert": { - "type": "string", - "description": "Client certificate." - }, - "tls_key": { - "type": "string", - "description": "Password for decrypting tls_cert." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "query_examples_disabled": { - "type": "boolean", - "description": "True if query examples are disabled." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra DSN parameters for MySQL connection." - } - }, - "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server." - }, - "v1QANMySQLSlowlogAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MySQL username for getting performance data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "tls_cert": { - "type": "string", - "description": "Client certificate." - }, - "tls_key": { - "type": "string", - "description": "Password for decrypting tls_cert." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "title": "Limit query length in QAN (default: server-defined; -1: no limit)" - }, - "query_examples_disabled": { - "type": "boolean", - "description": "True if query examples are disabled." - }, - "max_slowlog_file_size": { - "type": "string", - "format": "int64", - "description": "Slowlog file is rotated at this size if \u003e 0." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "title": "mod tidy" - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra DSN parameters for MySQL connection." - } - }, - "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server." - }, - "v1QANPostgreSQLPgStatMonitorAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "PostgreSQL username for getting pg stat monitor data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "query_examples_disabled": { - "type": "boolean", - "description": "True if query examples are disabled." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - }, - "description": "QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server." - }, - "v1QANPostgreSQLPgStatementsAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "PostgreSQL username for getting pg stat statements data." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - }, - "description": "QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server." - }, - "v1RDSExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "node_id": { - "type": "string", - "description": "Node identifier." - }, - "aws_access_key": { - "type": "string", - "description": "AWS Access Key." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status (the same for several configurations)." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics (the same for several configurations)." - }, - "basic_metrics_disabled": { - "type": "boolean", - "description": "Basic metrics are disabled." - }, - "enhanced_metrics_disabled": { - "type": "boolean", - "description": "Enhanced metrics are disabled." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "auto_discovery_limit": { - "type": "integer", - "format": "int32", - "description": "Limit of databases for auto-discovery." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - } - }, - "description": "RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics." - }, - "v1RTAMongoDBAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique agent identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MongoDB username for getting profiler data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "rta_options": { - "$ref": "#/definitions/v1RTAOptions", - "description": "Real-Time Analytics options." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - }, - "description": "RTAMongoDBAgent runs within pmm-agent and sends MongoDB Real-Time Query Analytics data to the PMM Server." - }, - "v1RTAOptions": { - "type": "object", - "properties": { - "collect_interval": { - "type": "string", - "description": "Query collect interval (default 2s is set by server)." - } - }, - "description": "RTAOptions holds Real-Time Query Analytics agent options." - }, - "v1RemoveAgentResponse": { - "type": "object" - }, - "v1VMAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - } - }, - "description": "VMAgent runs on Generic or Container Node alongside pmm-agent.\nIt scrapes other exporter Agents that are configured with push_metrics_enabled\nand uses Prometheus remote write protocol to push metrics to PMM Server." - }, - "v1ValkeyExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "Valkey username for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname verification." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "disabled_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of disabled collector names." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - } - }, - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey Service metrics." - } - } -} diff --git a/api/inventory/v1/agents_grpc.pb.go b/api/inventory/v1/agents_grpc.pb.go index bfb234718bc..0b4c6fc63e1 100644 --- a/api/inventory/v1/agents_grpc.pb.go +++ b/api/inventory/v1/agents_grpc.pb.go @@ -8,6 +8,7 @@ package inventoryv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -146,18 +147,23 @@ type UnimplementedAgentsServiceServer struct{} func (UnimplementedAgentsServiceServer) ListAgents(context.Context, *ListAgentsRequest) (*ListAgentsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAgents not implemented") } + func (UnimplementedAgentsServiceServer) GetAgent(context.Context, *GetAgentRequest) (*GetAgentResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetAgent not implemented") } + func (UnimplementedAgentsServiceServer) GetAgentLogs(context.Context, *GetAgentLogsRequest) (*GetAgentLogsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetAgentLogs not implemented") } + func (UnimplementedAgentsServiceServer) AddAgent(context.Context, *AddAgentRequest) (*AddAgentResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddAgent not implemented") } + func (UnimplementedAgentsServiceServer) ChangeAgent(context.Context, *ChangeAgentRequest) (*ChangeAgentResponse, error) { return nil, status.Error(codes.Unimplemented, "method ChangeAgent not implemented") } + func (UnimplementedAgentsServiceServer) RemoveAgent(context.Context, *RemoveAgentRequest) (*RemoveAgentResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveAgent not implemented") } diff --git a/api/inventory/v1/log_level.pb.go b/api/inventory/v1/log_level.pb.go index 16defbb9016..cd798d6fb86 100644 --- a/api/inventory/v1/log_level.pb.go +++ b/api/inventory/v1/log_level.pb.go @@ -7,11 +7,12 @@ package inventoryv1 import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -107,10 +108,13 @@ func file_inventory_v1_log_level_proto_rawDescGZIP() []byte { return file_inventory_v1_log_level_proto_rawDescData } -var file_inventory_v1_log_level_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_inventory_v1_log_level_proto_goTypes = []any{ - (LogLevel)(0), // 0: inventory.v1.LogLevel -} +var ( + file_inventory_v1_log_level_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_inventory_v1_log_level_proto_goTypes = []any{ + (LogLevel)(0), // 0: inventory.v1.LogLevel + } +) + var file_inventory_v1_log_level_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/inventory/v1/log_level.swagger.json b/api/inventory/v1/log_level.swagger.json deleted file mode 100644 index 0e16c21a9e1..00000000000 --- a/api/inventory/v1/log_level.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "inventory/v1/log_level.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/inventory/v1/nodes.pb.go b/api/inventory/v1/nodes.pb.go index 7391959ad03..672f9e43761 100644 --- a/api/inventory/v1/nodes.pb.go +++ b/api/inventory/v1/nodes.pb.go @@ -7,14 +7,15 @@ package inventoryv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" ) const ( @@ -2007,39 +2008,42 @@ func file_inventory_v1_nodes_proto_rawDescGZIP() []byte { return file_inventory_v1_nodes_proto_rawDescData } -var file_inventory_v1_nodes_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_inventory_v1_nodes_proto_msgTypes = make([]protoimpl.MessageInfo, 28) -var file_inventory_v1_nodes_proto_goTypes = []any{ - (NodeType)(0), // 0: inventory.v1.NodeType - (*GenericNode)(nil), // 1: inventory.v1.GenericNode - (*ContainerNode)(nil), // 2: inventory.v1.ContainerNode - (*RemoteNode)(nil), // 3: inventory.v1.RemoteNode - (*RemoteRDSNode)(nil), // 4: inventory.v1.RemoteRDSNode - (*RemoteAzureDatabaseNode)(nil), // 5: inventory.v1.RemoteAzureDatabaseNode - (*ListNodesRequest)(nil), // 6: inventory.v1.ListNodesRequest - (*ListNodesResponse)(nil), // 7: inventory.v1.ListNodesResponse - (*GetNodeRequest)(nil), // 8: inventory.v1.GetNodeRequest - (*GetNodeResponse)(nil), // 9: inventory.v1.GetNodeResponse - (*AddNodeRequest)(nil), // 10: inventory.v1.AddNodeRequest - (*AddNodeResponse)(nil), // 11: inventory.v1.AddNodeResponse - (*AddGenericNodeParams)(nil), // 12: inventory.v1.AddGenericNodeParams - (*AddContainerNodeParams)(nil), // 13: inventory.v1.AddContainerNodeParams - (*AddRemoteNodeParams)(nil), // 14: inventory.v1.AddRemoteNodeParams - (*AddRemoteRDSNodeParams)(nil), // 15: inventory.v1.AddRemoteRDSNodeParams - (*AddRemoteAzureNodeParams)(nil), // 16: inventory.v1.AddRemoteAzureNodeParams - (*RemoveNodeRequest)(nil), // 17: inventory.v1.RemoveNodeRequest - (*RemoveNodeResponse)(nil), // 18: inventory.v1.RemoveNodeResponse - nil, // 19: inventory.v1.GenericNode.CustomLabelsEntry - nil, // 20: inventory.v1.ContainerNode.CustomLabelsEntry - nil, // 21: inventory.v1.RemoteNode.CustomLabelsEntry - nil, // 22: inventory.v1.RemoteRDSNode.CustomLabelsEntry - nil, // 23: inventory.v1.RemoteAzureDatabaseNode.CustomLabelsEntry - nil, // 24: inventory.v1.AddGenericNodeParams.CustomLabelsEntry - nil, // 25: inventory.v1.AddContainerNodeParams.CustomLabelsEntry - nil, // 26: inventory.v1.AddRemoteNodeParams.CustomLabelsEntry - nil, // 27: inventory.v1.AddRemoteRDSNodeParams.CustomLabelsEntry - nil, // 28: inventory.v1.AddRemoteAzureNodeParams.CustomLabelsEntry -} +var ( + file_inventory_v1_nodes_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_inventory_v1_nodes_proto_msgTypes = make([]protoimpl.MessageInfo, 28) + file_inventory_v1_nodes_proto_goTypes = []any{ + (NodeType)(0), // 0: inventory.v1.NodeType + (*GenericNode)(nil), // 1: inventory.v1.GenericNode + (*ContainerNode)(nil), // 2: inventory.v1.ContainerNode + (*RemoteNode)(nil), // 3: inventory.v1.RemoteNode + (*RemoteRDSNode)(nil), // 4: inventory.v1.RemoteRDSNode + (*RemoteAzureDatabaseNode)(nil), // 5: inventory.v1.RemoteAzureDatabaseNode + (*ListNodesRequest)(nil), // 6: inventory.v1.ListNodesRequest + (*ListNodesResponse)(nil), // 7: inventory.v1.ListNodesResponse + (*GetNodeRequest)(nil), // 8: inventory.v1.GetNodeRequest + (*GetNodeResponse)(nil), // 9: inventory.v1.GetNodeResponse + (*AddNodeRequest)(nil), // 10: inventory.v1.AddNodeRequest + (*AddNodeResponse)(nil), // 11: inventory.v1.AddNodeResponse + (*AddGenericNodeParams)(nil), // 12: inventory.v1.AddGenericNodeParams + (*AddContainerNodeParams)(nil), // 13: inventory.v1.AddContainerNodeParams + (*AddRemoteNodeParams)(nil), // 14: inventory.v1.AddRemoteNodeParams + (*AddRemoteRDSNodeParams)(nil), // 15: inventory.v1.AddRemoteRDSNodeParams + (*AddRemoteAzureNodeParams)(nil), // 16: inventory.v1.AddRemoteAzureNodeParams + (*RemoveNodeRequest)(nil), // 17: inventory.v1.RemoveNodeRequest + (*RemoveNodeResponse)(nil), // 18: inventory.v1.RemoveNodeResponse + nil, // 19: inventory.v1.GenericNode.CustomLabelsEntry + nil, // 20: inventory.v1.ContainerNode.CustomLabelsEntry + nil, // 21: inventory.v1.RemoteNode.CustomLabelsEntry + nil, // 22: inventory.v1.RemoteRDSNode.CustomLabelsEntry + nil, // 23: inventory.v1.RemoteAzureDatabaseNode.CustomLabelsEntry + nil, // 24: inventory.v1.AddGenericNodeParams.CustomLabelsEntry + nil, // 25: inventory.v1.AddContainerNodeParams.CustomLabelsEntry + nil, // 26: inventory.v1.AddRemoteNodeParams.CustomLabelsEntry + nil, // 27: inventory.v1.AddRemoteRDSNodeParams.CustomLabelsEntry + nil, // 28: inventory.v1.AddRemoteAzureNodeParams.CustomLabelsEntry + } +) + var file_inventory_v1_nodes_proto_depIdxs = []int32{ 19, // 0: inventory.v1.GenericNode.custom_labels:type_name -> inventory.v1.GenericNode.CustomLabelsEntry 20, // 1: inventory.v1.ContainerNode.custom_labels:type_name -> inventory.v1.ContainerNode.CustomLabelsEntry diff --git a/api/inventory/v1/nodes.swagger.json b/api/inventory/v1/nodes.swagger.json deleted file mode 100644 index 32958ba155f..00000000000 --- a/api/inventory/v1/nodes.swagger.json +++ /dev/null @@ -1,708 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "inventory/v1/nodes.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "NodesService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/inventory/nodes": { - "get": { - "summary": "List Nodes", - "description": "Returns a list of all Nodes.", - "operationId": "ListNodes", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListNodesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "node_type", - "description": "Return only Nodes with matching Node type.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ], - "default": "NODE_TYPE_UNSPECIFIED" - } - ], - "tags": [ - "NodesService" - ] - }, - "post": { - "summary": "Add a Node", - "description": "Adds a Node.", - "operationId": "AddNode", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1AddNodeResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1AddNodeRequest" - } - } - ], - "tags": [ - "NodesService" - ] - } - }, - "/v1/inventory/nodes/{node_id}": { - "get": { - "summary": "Get a Node", - "description": "Returns a single Node by ID.", - "operationId": "GetNode", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetNodeResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "node_id", - "description": "Unique randomly generated instance identifier.", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "NodesService" - ] - }, - "delete": { - "summary": "Remove a Node", - "description": "Removes a Node.", - "operationId": "RemoveNode", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1RemoveNodeResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "node_id", - "description": "Unique randomly generated instance identifier.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "force", - "description": "Remove node with all dependencies.", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "tags": [ - "NodesService" - ] - } - } - }, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1AddContainerNodeParams": { - "type": "object", - "properties": { - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "address": { - "type": "string", - "description": "Node address (DNS name or IP)." - }, - "machine_id": { - "type": "string", - "description": "Linux machine-id of the Generic Node where this Container Node runs." - }, - "container_id": { - "type": "string", - "description": "Container identifier. If specified, must be a unique Docker container identifier." - }, - "container_name": { - "type": "string", - "description": "Container name." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - } - }, - "v1AddGenericNodeParams": { - "type": "object", - "properties": { - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "address": { - "type": "string", - "description": "Node address (DNS name or IP)." - }, - "machine_id": { - "type": "string", - "description": "Linux machine-id." - }, - "distro": { - "type": "string", - "description": "Linux distribution name and version." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - } - }, - "v1AddNodeRequest": { - "type": "object", - "properties": { - "generic": { - "$ref": "#/definitions/v1AddGenericNodeParams" - }, - "container": { - "$ref": "#/definitions/v1AddContainerNodeParams" - }, - "remote": { - "$ref": "#/definitions/v1AddRemoteNodeParams" - }, - "remote_rds": { - "$ref": "#/definitions/v1AddRemoteRDSNodeParams" - }, - "remote_azure": { - "$ref": "#/definitions/v1AddRemoteAzureNodeParams" - } - } - }, - "v1AddNodeResponse": { - "type": "object", - "properties": { - "generic": { - "$ref": "#/definitions/v1GenericNode" - }, - "container": { - "$ref": "#/definitions/v1ContainerNode" - }, - "remote": { - "$ref": "#/definitions/v1RemoteNode" - }, - "remote_rds": { - "$ref": "#/definitions/v1RemoteRDSNode" - }, - "remote_azure_database": { - "$ref": "#/definitions/v1RemoteAzureDatabaseNode" - } - } - }, - "v1AddRemoteAzureNodeParams": { - "type": "object", - "properties": { - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "address": { - "type": "string", - "description": "DB instance identifier." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - } - }, - "v1AddRemoteNodeParams": { - "type": "object", - "properties": { - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "address": { - "type": "string", - "description": "Node address (DNS name or IP)." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - } - }, - "v1AddRemoteRDSNodeParams": { - "type": "object", - "properties": { - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "address": { - "type": "string", - "description": "DB instance identifier." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - } - }, - "v1ContainerNode": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "address": { - "type": "string", - "description": "Node address (DNS name or IP)." - }, - "machine_id": { - "type": "string", - "description": "Linux machine-id of the Generic Node where this Container Node runs." - }, - "container_id": { - "type": "string", - "description": "Container identifier. If specified, must be a unique Docker container identifier." - }, - "container_name": { - "type": "string", - "description": "Container name." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "is_pmm_server_node": { - "type": "boolean", - "description": "True if this node is a PMM Server node (HA mode)." - } - }, - "description": "ContainerNode represents a Docker container." - }, - "v1GenericNode": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "address": { - "type": "string", - "description": "Node address (DNS name or IP)." - }, - "machine_id": { - "type": "string", - "description": "Linux machine-id." - }, - "distro": { - "type": "string", - "description": "Linux distribution name and version." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "is_pmm_server_node": { - "type": "boolean", - "description": "True if this node is a PMM Server node (HA mode)." - } - }, - "description": "GenericNode represents a bare metal server or virtual machine." - }, - "v1GetNodeResponse": { - "type": "object", - "properties": { - "generic": { - "$ref": "#/definitions/v1GenericNode" - }, - "container": { - "$ref": "#/definitions/v1ContainerNode" - }, - "remote": { - "$ref": "#/definitions/v1RemoteNode" - }, - "remote_rds": { - "$ref": "#/definitions/v1RemoteRDSNode" - }, - "remote_azure_database": { - "$ref": "#/definitions/v1RemoteAzureDatabaseNode" - } - } - }, - "v1ListNodesResponse": { - "type": "object", - "properties": { - "generic": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1GenericNode" - } - }, - "container": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1ContainerNode" - } - }, - "remote": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1RemoteNode" - } - }, - "remote_rds": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1RemoteRDSNode" - } - }, - "remote_azure_database": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1RemoteAzureDatabaseNode" - } - } - } - }, - "v1NodeType": { - "type": "string", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ], - "default": "NODE_TYPE_UNSPECIFIED", - "description": "NodeType describes supported Node types." - }, - "v1RemoteAzureDatabaseNode": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "address": { - "type": "string", - "description": "DB instance identifier." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - }, - "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes." - }, - "v1RemoteNode": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "address": { - "type": "string", - "description": "Node address (DNS name or IP)." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - }, - "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." - }, - "v1RemoteRDSNode": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "address": { - "type": "string", - "description": "DB instance identifier." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "instance_id": { - "type": "string", - "description": "AWS instance ID." - } - }, - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes." - }, - "v1RemoveNodeResponse": { - "type": "object" - } - } -} diff --git a/api/inventory/v1/nodes_grpc.pb.go b/api/inventory/v1/nodes_grpc.pb.go index 14c8f370438..7142c1b4a15 100644 --- a/api/inventory/v1/nodes_grpc.pb.go +++ b/api/inventory/v1/nodes_grpc.pb.go @@ -8,6 +8,7 @@ package inventoryv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -116,12 +117,15 @@ type UnimplementedNodesServiceServer struct{} func (UnimplementedNodesServiceServer) ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListNodes not implemented") } + func (UnimplementedNodesServiceServer) GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetNode not implemented") } + func (UnimplementedNodesServiceServer) AddNode(context.Context, *AddNodeRequest) (*AddNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddNode not implemented") } + func (UnimplementedNodesServiceServer) RemoveNode(context.Context, *RemoveNodeRequest) (*RemoveNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveNode not implemented") } diff --git a/api/inventory/v1/services.pb.go b/api/inventory/v1/services.pb.go index d1a54903862..0ca7d8acb26 100644 --- a/api/inventory/v1/services.pb.go +++ b/api/inventory/v1/services.pb.go @@ -7,15 +7,17 @@ package inventoryv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - common "github.com/percona/pmm/api/common" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" + + common "github.com/percona/pmm/api/common" ) const ( @@ -3282,54 +3284,57 @@ func file_inventory_v1_services_proto_rawDescGZIP() []byte { return file_inventory_v1_services_proto_rawDescData } -var file_inventory_v1_services_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_inventory_v1_services_proto_msgTypes = make([]protoimpl.MessageInfo, 42) -var file_inventory_v1_services_proto_goTypes = []any{ - (ServiceType)(0), // 0: inventory.v1.ServiceType - (*MySQLService)(nil), // 1: inventory.v1.MySQLService - (*MongoDBService)(nil), // 2: inventory.v1.MongoDBService - (*PostgreSQLService)(nil), // 3: inventory.v1.PostgreSQLService - (*ValkeyService)(nil), // 4: inventory.v1.ValkeyService - (*ProxySQLService)(nil), // 5: inventory.v1.ProxySQLService - (*HAProxyService)(nil), // 6: inventory.v1.HAProxyService - (*ExternalService)(nil), // 7: inventory.v1.ExternalService - (*ListServicesRequest)(nil), // 8: inventory.v1.ListServicesRequest - (*ListServicesResponse)(nil), // 9: inventory.v1.ListServicesResponse - (*ListActiveServiceTypesRequest)(nil), // 10: inventory.v1.ListActiveServiceTypesRequest - (*ListActiveServiceTypesResponse)(nil), // 11: inventory.v1.ListActiveServiceTypesResponse - (*GetServiceRequest)(nil), // 12: inventory.v1.GetServiceRequest - (*GetServiceResponse)(nil), // 13: inventory.v1.GetServiceResponse - (*AddServiceRequest)(nil), // 14: inventory.v1.AddServiceRequest - (*AddServiceResponse)(nil), // 15: inventory.v1.AddServiceResponse - (*AddMySQLServiceParams)(nil), // 16: inventory.v1.AddMySQLServiceParams - (*AddMongoDBServiceParams)(nil), // 17: inventory.v1.AddMongoDBServiceParams - (*AddPostgreSQLServiceParams)(nil), // 18: inventory.v1.AddPostgreSQLServiceParams - (*AddValkeyServiceParams)(nil), // 19: inventory.v1.AddValkeyServiceParams - (*AddProxySQLServiceParams)(nil), // 20: inventory.v1.AddProxySQLServiceParams - (*AddHAProxyServiceParams)(nil), // 21: inventory.v1.AddHAProxyServiceParams - (*AddExternalServiceParams)(nil), // 22: inventory.v1.AddExternalServiceParams - (*RemoveServiceRequest)(nil), // 23: inventory.v1.RemoveServiceRequest - (*RemoveServiceResponse)(nil), // 24: inventory.v1.RemoveServiceResponse - (*ChangeServiceRequest)(nil), // 25: inventory.v1.ChangeServiceRequest - (*ChangeServiceResponse)(nil), // 26: inventory.v1.ChangeServiceResponse - nil, // 27: inventory.v1.MySQLService.CustomLabelsEntry - nil, // 28: inventory.v1.MySQLService.ExtraDsnParamsEntry - nil, // 29: inventory.v1.MongoDBService.CustomLabelsEntry - nil, // 30: inventory.v1.PostgreSQLService.CustomLabelsEntry - nil, // 31: inventory.v1.ValkeyService.CustomLabelsEntry - nil, // 32: inventory.v1.ProxySQLService.CustomLabelsEntry - nil, // 33: inventory.v1.HAProxyService.CustomLabelsEntry - nil, // 34: inventory.v1.ExternalService.CustomLabelsEntry - nil, // 35: inventory.v1.AddMySQLServiceParams.CustomLabelsEntry - nil, // 36: inventory.v1.AddMySQLServiceParams.ExtraDsnParamsEntry - nil, // 37: inventory.v1.AddMongoDBServiceParams.CustomLabelsEntry - nil, // 38: inventory.v1.AddPostgreSQLServiceParams.CustomLabelsEntry - nil, // 39: inventory.v1.AddValkeyServiceParams.CustomLabelsEntry - nil, // 40: inventory.v1.AddProxySQLServiceParams.CustomLabelsEntry - nil, // 41: inventory.v1.AddHAProxyServiceParams.CustomLabelsEntry - nil, // 42: inventory.v1.AddExternalServiceParams.CustomLabelsEntry - (*common.StringMap)(nil), // 43: common.StringMap -} +var ( + file_inventory_v1_services_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_inventory_v1_services_proto_msgTypes = make([]protoimpl.MessageInfo, 42) + file_inventory_v1_services_proto_goTypes = []any{ + (ServiceType)(0), // 0: inventory.v1.ServiceType + (*MySQLService)(nil), // 1: inventory.v1.MySQLService + (*MongoDBService)(nil), // 2: inventory.v1.MongoDBService + (*PostgreSQLService)(nil), // 3: inventory.v1.PostgreSQLService + (*ValkeyService)(nil), // 4: inventory.v1.ValkeyService + (*ProxySQLService)(nil), // 5: inventory.v1.ProxySQLService + (*HAProxyService)(nil), // 6: inventory.v1.HAProxyService + (*ExternalService)(nil), // 7: inventory.v1.ExternalService + (*ListServicesRequest)(nil), // 8: inventory.v1.ListServicesRequest + (*ListServicesResponse)(nil), // 9: inventory.v1.ListServicesResponse + (*ListActiveServiceTypesRequest)(nil), // 10: inventory.v1.ListActiveServiceTypesRequest + (*ListActiveServiceTypesResponse)(nil), // 11: inventory.v1.ListActiveServiceTypesResponse + (*GetServiceRequest)(nil), // 12: inventory.v1.GetServiceRequest + (*GetServiceResponse)(nil), // 13: inventory.v1.GetServiceResponse + (*AddServiceRequest)(nil), // 14: inventory.v1.AddServiceRequest + (*AddServiceResponse)(nil), // 15: inventory.v1.AddServiceResponse + (*AddMySQLServiceParams)(nil), // 16: inventory.v1.AddMySQLServiceParams + (*AddMongoDBServiceParams)(nil), // 17: inventory.v1.AddMongoDBServiceParams + (*AddPostgreSQLServiceParams)(nil), // 18: inventory.v1.AddPostgreSQLServiceParams + (*AddValkeyServiceParams)(nil), // 19: inventory.v1.AddValkeyServiceParams + (*AddProxySQLServiceParams)(nil), // 20: inventory.v1.AddProxySQLServiceParams + (*AddHAProxyServiceParams)(nil), // 21: inventory.v1.AddHAProxyServiceParams + (*AddExternalServiceParams)(nil), // 22: inventory.v1.AddExternalServiceParams + (*RemoveServiceRequest)(nil), // 23: inventory.v1.RemoveServiceRequest + (*RemoveServiceResponse)(nil), // 24: inventory.v1.RemoveServiceResponse + (*ChangeServiceRequest)(nil), // 25: inventory.v1.ChangeServiceRequest + (*ChangeServiceResponse)(nil), // 26: inventory.v1.ChangeServiceResponse + nil, // 27: inventory.v1.MySQLService.CustomLabelsEntry + nil, // 28: inventory.v1.MySQLService.ExtraDsnParamsEntry + nil, // 29: inventory.v1.MongoDBService.CustomLabelsEntry + nil, // 30: inventory.v1.PostgreSQLService.CustomLabelsEntry + nil, // 31: inventory.v1.ValkeyService.CustomLabelsEntry + nil, // 32: inventory.v1.ProxySQLService.CustomLabelsEntry + nil, // 33: inventory.v1.HAProxyService.CustomLabelsEntry + nil, // 34: inventory.v1.ExternalService.CustomLabelsEntry + nil, // 35: inventory.v1.AddMySQLServiceParams.CustomLabelsEntry + nil, // 36: inventory.v1.AddMySQLServiceParams.ExtraDsnParamsEntry + nil, // 37: inventory.v1.AddMongoDBServiceParams.CustomLabelsEntry + nil, // 38: inventory.v1.AddPostgreSQLServiceParams.CustomLabelsEntry + nil, // 39: inventory.v1.AddValkeyServiceParams.CustomLabelsEntry + nil, // 40: inventory.v1.AddProxySQLServiceParams.CustomLabelsEntry + nil, // 41: inventory.v1.AddHAProxyServiceParams.CustomLabelsEntry + nil, // 42: inventory.v1.AddExternalServiceParams.CustomLabelsEntry + (*common.StringMap)(nil), // 43: common.StringMap + } +) + var file_inventory_v1_services_proto_depIdxs = []int32{ 27, // 0: inventory.v1.MySQLService.custom_labels:type_name -> inventory.v1.MySQLService.CustomLabelsEntry 28, // 1: inventory.v1.MySQLService.extra_dsn_params:type_name -> inventory.v1.MySQLService.ExtraDsnParamsEntry diff --git a/api/inventory/v1/services.pb.validate.go b/api/inventory/v1/services.pb.validate.go index 6f939fb5f8f..79783d70e5d 100644 --- a/api/inventory/v1/services.pb.validate.go +++ b/api/inventory/v1/services.pb.validate.go @@ -4062,7 +4062,6 @@ func (m *ChangeServiceRequest) validate(all bool) error { } if m.CustomLabels != nil { - if all { switch v := interface{}(m.GetCustomLabels()).(type) { case interface{ ValidateAll() error }: @@ -4091,7 +4090,6 @@ func (m *ChangeServiceRequest) validate(all bool) error { } } } - } if len(errors) > 0 { diff --git a/api/inventory/v1/services.swagger.json b/api/inventory/v1/services.swagger.json deleted file mode 100644 index ab118f837ff..00000000000 --- a/api/inventory/v1/services.swagger.json +++ /dev/null @@ -1,1189 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "inventory/v1/services.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "ServicesService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/inventory/services": { - "get": { - "summary": "List Services", - "description": "Returns a list of Services filtered by type.", - "operationId": "ListServices", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListServicesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "node_id", - "description": "Return only Services running on that Node.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "service_type", - "description": "Return only services filtered by service type.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "SERVICE_TYPE_UNSPECIFIED", - "SERVICE_TYPE_MYSQL_SERVICE", - "SERVICE_TYPE_MONGODB_SERVICE", - "SERVICE_TYPE_POSTGRESQL_SERVICE", - "SERVICE_TYPE_VALKEY_SERVICE", - "SERVICE_TYPE_PROXYSQL_SERVICE", - "SERVICE_TYPE_HAPROXY_SERVICE", - "SERVICE_TYPE_EXTERNAL_SERVICE" - ], - "default": "SERVICE_TYPE_UNSPECIFIED" - }, - { - "name": "external_group", - "description": "Return only services in this external group.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "ServicesService" - ] - }, - "post": { - "summary": "Add a Service", - "description": "Adds a Service.", - "operationId": "AddService", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1AddServiceResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1AddServiceRequest" - } - } - ], - "tags": [ - "ServicesService" - ] - } - }, - "/v1/inventory/services/{service_id}": { - "get": { - "summary": "Get a Service", - "description": "Returns a single Service by ID.", - "operationId": "GetService", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetServiceResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "service_id", - "description": "Unique randomly generated instance identifier.", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "ServicesService" - ] - }, - "delete": { - "summary": "Remove Service", - "description": "Removes Service.", - "operationId": "RemoveService", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1RemoveServiceResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "service_id", - "description": "Unique randomly generated instance identifier. Required.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "force", - "description": "Remove service with all dependencies.", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "tags": [ - "ServicesService" - ] - }, - "put": { - "summary": "Change service", - "description": "Changes service configuration. If a new cluster label is specified, it removes all backup/restore tasks scheduled for the related services. Fails if there are running backup/restore tasks.", - "operationId": "ChangeService", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ChangeServiceResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "service_id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ServicesServiceChangeServiceBody" - } - } - ], - "tags": [ - "ServicesService" - ] - } - }, - "/v1/inventory/services:getTypes": { - "post": { - "summary": "List Active Service Types", - "description": "Returns a list of active Service types.", - "operationId": "ListActiveServiceTypes", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListActiveServiceTypesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1ListActiveServiceTypesRequest" - } - } - ], - "tags": [ - "ServicesService" - ] - } - } - }, - "definitions": { - "ServicesServiceChangeServiceBody": { - "type": "object", - "properties": { - "environment": { - "type": "string", - "x-nullable": true - }, - "cluster": { - "type": "string", - "x-nullable": true - }, - "replication_set": { - "type": "string", - "x-nullable": true - }, - "external_group": { - "type": "string", - "x-nullable": true - }, - "custom_labels": { - "$ref": "#/definitions/commonStringMap", - "x-nullable": true, - "description": "Replace all custom user-assigned labels." - } - } - }, - "commonStringMap": { - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value." - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1AddExternalServiceParams": { - "type": "object", - "properties": { - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Required." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs. Required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "group": { - "type": "string", - "description": "Group name of external service." - } - } - }, - "v1AddHAProxyServiceParams": { - "type": "object", - "properties": { - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Required." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs. Required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - } - }, - "v1AddMongoDBServiceParams": { - "type": "object", - "properties": { - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Required." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs. Required." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - } - }, - "v1AddMySQLServiceParams": { - "type": "object", - "properties": { - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Required." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs. Required." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra parameters to be added to the DSN." - } - } - }, - "v1AddPostgreSQLServiceParams": { - "type": "object", - "properties": { - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Required." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs. Required." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "auto_discovery_limit": { - "type": "integer", - "format": "int32", - "description": "Limit of databases for auto-discovery." - } - } - }, - "v1AddProxySQLServiceParams": { - "type": "object", - "properties": { - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Required." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs. Required." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - } - }, - "v1AddServiceRequest": { - "type": "object", - "properties": { - "mysql": { - "$ref": "#/definitions/v1AddMySQLServiceParams" - }, - "mongodb": { - "$ref": "#/definitions/v1AddMongoDBServiceParams" - }, - "postgresql": { - "$ref": "#/definitions/v1AddPostgreSQLServiceParams" - }, - "proxysql": { - "$ref": "#/definitions/v1AddProxySQLServiceParams" - }, - "haproxy": { - "$ref": "#/definitions/v1AddHAProxyServiceParams" - }, - "external": { - "$ref": "#/definitions/v1AddExternalServiceParams" - }, - "valkey": { - "$ref": "#/definitions/v1AddValkeyServiceParams" - } - } - }, - "v1AddServiceResponse": { - "type": "object", - "properties": { - "mysql": { - "$ref": "#/definitions/v1MySQLService" - }, - "mongodb": { - "$ref": "#/definitions/v1MongoDBService" - }, - "postgresql": { - "$ref": "#/definitions/v1PostgreSQLService" - }, - "proxysql": { - "$ref": "#/definitions/v1ProxySQLService" - }, - "haproxy": { - "$ref": "#/definitions/v1HAProxyService" - }, - "external": { - "$ref": "#/definitions/v1ExternalService" - }, - "valkey": { - "$ref": "#/definitions/v1ValkeyService" - } - } - }, - "v1AddValkeyServiceParams": { - "type": "object", - "properties": { - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Required." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs. Required." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - } - }, - "v1ChangeServiceResponse": { - "type": "object", - "properties": { - "mysql": { - "$ref": "#/definitions/v1MySQLService" - }, - "mongodb": { - "$ref": "#/definitions/v1MongoDBService" - }, - "postgresql": { - "$ref": "#/definitions/v1PostgreSQLService" - }, - "proxysql": { - "$ref": "#/definitions/v1ProxySQLService" - }, - "haproxy": { - "$ref": "#/definitions/v1HAProxyService" - }, - "external": { - "$ref": "#/definitions/v1ExternalService" - }, - "valkey": { - "$ref": "#/definitions/v1ValkeyService" - } - } - }, - "v1ExternalService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this service instance runs." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "group": { - "type": "string", - "description": "Group name of external service." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP)." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port." - } - }, - "description": "ExternalService represents a generic External service instance." - }, - "v1GetServiceResponse": { - "type": "object", - "properties": { - "mysql": { - "$ref": "#/definitions/v1MySQLService" - }, - "mongodb": { - "$ref": "#/definitions/v1MongoDBService" - }, - "postgresql": { - "$ref": "#/definitions/v1PostgreSQLService" - }, - "proxysql": { - "$ref": "#/definitions/v1ProxySQLService" - }, - "haproxy": { - "$ref": "#/definitions/v1HAProxyService" - }, - "external": { - "$ref": "#/definitions/v1ExternalService" - }, - "valkey": { - "$ref": "#/definitions/v1ValkeyService" - } - } - }, - "v1HAProxyService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this service instance runs." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - }, - "description": "HAProxyService represents a generic HAProxy service instance." - }, - "v1ListActiveServiceTypesRequest": { - "type": "object" - }, - "v1ListActiveServiceTypesResponse": { - "type": "object", - "properties": { - "service_types": { - "type": "array", - "items": { - "$ref": "#/definitions/v1ServiceType" - } - } - } - }, - "v1ListServicesResponse": { - "type": "object", - "properties": { - "mysql": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1MySQLService" - } - }, - "mongodb": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1MongoDBService" - } - }, - "postgresql": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1PostgreSQLService" - } - }, - "proxysql": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1ProxySQLService" - } - }, - "haproxy": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1HAProxyService" - } - }, - "external": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1ExternalService" - } - }, - "valkey": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1ValkeyService" - } - } - } - }, - "v1MongoDBService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "version": { - "type": "string", - "description": "MongoDB version." - } - }, - "description": "MongoDBService represents a generic MongoDB instance." - }, - "v1MySQLService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "version": { - "type": "string", - "description": "MySQL version." - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra parameters to be added to the DSN." - } - }, - "description": "MySQLService represents a generic MySQL instance." - }, - "v1PostgreSQLService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "database_name": { - "type": "string", - "description": "Database name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "version": { - "type": "string", - "description": "PostgreSQL version." - }, - "auto_discovery_limit": { - "type": "integer", - "format": "int32", - "description": "Limit of databases for auto-discovery." - } - }, - "description": "PostgreSQLService represents a generic PostgreSQL instance." - }, - "v1ProxySQLService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "version": { - "type": "string", - "description": "ProxySQL version." - } - }, - "description": "ProxySQLService represents a generic ProxySQL instance." - }, - "v1RemoveServiceResponse": { - "type": "object" - }, - "v1ServiceType": { - "type": "string", - "enum": [ - "SERVICE_TYPE_UNSPECIFIED", - "SERVICE_TYPE_MYSQL_SERVICE", - "SERVICE_TYPE_MONGODB_SERVICE", - "SERVICE_TYPE_POSTGRESQL_SERVICE", - "SERVICE_TYPE_VALKEY_SERVICE", - "SERVICE_TYPE_PROXYSQL_SERVICE", - "SERVICE_TYPE_HAPROXY_SERVICE", - "SERVICE_TYPE_EXTERNAL_SERVICE" - ], - "default": "SERVICE_TYPE_UNSPECIFIED", - "description": "ServiceType describes supported Service types." - }, - "v1ValkeyService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "version": { - "type": "string", - "description": "Valkey version." - } - }, - "description": "ValkeyService represents a generic Valkey instance." - } - } -} diff --git a/api/inventory/v1/services_grpc.pb.go b/api/inventory/v1/services_grpc.pb.go index 27f42369172..1de232e4cc5 100644 --- a/api/inventory/v1/services_grpc.pb.go +++ b/api/inventory/v1/services_grpc.pb.go @@ -8,6 +8,7 @@ package inventoryv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -146,18 +147,23 @@ type UnimplementedServicesServiceServer struct{} func (UnimplementedServicesServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListServices not implemented") } + func (UnimplementedServicesServiceServer) ListActiveServiceTypes(context.Context, *ListActiveServiceTypesRequest) (*ListActiveServiceTypesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListActiveServiceTypes not implemented") } + func (UnimplementedServicesServiceServer) GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetService not implemented") } + func (UnimplementedServicesServiceServer) AddService(context.Context, *AddServiceRequest) (*AddServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddService not implemented") } + func (UnimplementedServicesServiceServer) RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveService not implemented") } + func (UnimplementedServicesServiceServer) ChangeService(context.Context, *ChangeServiceRequest) (*ChangeServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method ChangeService not implemented") } diff --git a/api/management/v1/agent.pb.go b/api/management/v1/agent.pb.go index 7661cbe75cc..8225cca8957 100644 --- a/api/management/v1/agent.pb.go +++ b/api/management/v1/agent.pb.go @@ -7,13 +7,15 @@ package managementv1 import ( - v1 "github.com/percona/pmm/api/inventory/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -1203,27 +1205,30 @@ func file_management_v1_agent_proto_rawDescGZIP() []byte { return file_management_v1_agent_proto_rawDescData } -var file_management_v1_agent_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_management_v1_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_management_v1_agent_proto_goTypes = []any{ - (UpdateSeverity)(0), // 0: management.v1.UpdateSeverity - (*UniversalAgent)(nil), // 1: management.v1.UniversalAgent - (*ListAgentsRequest)(nil), // 2: management.v1.ListAgentsRequest - (*ListAgentsResponse)(nil), // 3: management.v1.ListAgentsResponse - (*AgentVersions)(nil), // 4: management.v1.AgentVersions - (*ListAgentVersionsRequest)(nil), // 5: management.v1.ListAgentVersionsRequest - (*ListAgentVersionsResponse)(nil), // 6: management.v1.ListAgentVersionsResponse - (*UniversalAgent_MySQLOptions)(nil), // 7: management.v1.UniversalAgent.MySQLOptions - (*UniversalAgent_AzureOptions)(nil), // 8: management.v1.UniversalAgent.AzureOptions - (*UniversalAgent_MongoDBOptions)(nil), // 9: management.v1.UniversalAgent.MongoDBOptions - (*UniversalAgent_PostgreSQLOptions)(nil), // 10: management.v1.UniversalAgent.PostgreSQLOptions - (*UniversalAgent_ValkeyOptions)(nil), // 11: management.v1.UniversalAgent.ValkeyOptions - nil, // 12: management.v1.UniversalAgent.CustomLabelsEntry - nil, // 13: management.v1.UniversalAgent.MySQLOptions.ExtraDsnParamsEntry - (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp - (v1.LogLevel)(0), // 15: inventory.v1.LogLevel - (*v1.RTAOptions)(nil), // 16: inventory.v1.RTAOptions -} +var ( + file_management_v1_agent_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_management_v1_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 13) + file_management_v1_agent_proto_goTypes = []any{ + (UpdateSeverity)(0), // 0: management.v1.UpdateSeverity + (*UniversalAgent)(nil), // 1: management.v1.UniversalAgent + (*ListAgentsRequest)(nil), // 2: management.v1.ListAgentsRequest + (*ListAgentsResponse)(nil), // 3: management.v1.ListAgentsResponse + (*AgentVersions)(nil), // 4: management.v1.AgentVersions + (*ListAgentVersionsRequest)(nil), // 5: management.v1.ListAgentVersionsRequest + (*ListAgentVersionsResponse)(nil), // 6: management.v1.ListAgentVersionsResponse + (*UniversalAgent_MySQLOptions)(nil), // 7: management.v1.UniversalAgent.MySQLOptions + (*UniversalAgent_AzureOptions)(nil), // 8: management.v1.UniversalAgent.AzureOptions + (*UniversalAgent_MongoDBOptions)(nil), // 9: management.v1.UniversalAgent.MongoDBOptions + (*UniversalAgent_PostgreSQLOptions)(nil), // 10: management.v1.UniversalAgent.PostgreSQLOptions + (*UniversalAgent_ValkeyOptions)(nil), // 11: management.v1.UniversalAgent.ValkeyOptions + nil, // 12: management.v1.UniversalAgent.CustomLabelsEntry + nil, // 13: management.v1.UniversalAgent.MySQLOptions.ExtraDsnParamsEntry + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp + (v1.LogLevel)(0), // 15: inventory.v1.LogLevel + (*v1.RTAOptions)(nil), // 16: inventory.v1.RTAOptions + } +) + var file_management_v1_agent_proto_depIdxs = []int32{ 8, // 0: management.v1.UniversalAgent.azure_options:type_name -> management.v1.UniversalAgent.AzureOptions 14, // 1: management.v1.UniversalAgent.created_at:type_name -> google.protobuf.Timestamp diff --git a/api/management/v1/agent.swagger.json b/api/management/v1/agent.swagger.json deleted file mode 100644 index 66ea6d4a070..00000000000 --- a/api/management/v1/agent.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/agent.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/management/v1/annotation.pb.go b/api/management/v1/annotation.pb.go index d014773c308..ec781561e4c 100644 --- a/api/management/v1/annotation.pb.go +++ b/api/management/v1/annotation.pb.go @@ -7,12 +7,13 @@ package managementv1 import ( - _ "github.com/envoyproxy/protoc-gen-validate/validate" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -156,11 +157,14 @@ func file_management_v1_annotation_proto_rawDescGZIP() []byte { return file_management_v1_annotation_proto_rawDescData } -var file_management_v1_annotation_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_management_v1_annotation_proto_goTypes = []any{ - (*AddAnnotationRequest)(nil), // 0: management.v1.AddAnnotationRequest - (*AddAnnotationResponse)(nil), // 1: management.v1.AddAnnotationResponse -} +var ( + file_management_v1_annotation_proto_msgTypes = make([]protoimpl.MessageInfo, 2) + file_management_v1_annotation_proto_goTypes = []any{ + (*AddAnnotationRequest)(nil), // 0: management.v1.AddAnnotationRequest + (*AddAnnotationResponse)(nil), // 1: management.v1.AddAnnotationResponse + } +) + var file_management_v1_annotation_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/management/v1/annotation.swagger.json b/api/management/v1/annotation.swagger.json deleted file mode 100644 index 3d5937159fb..00000000000 --- a/api/management/v1/annotation.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/annotation.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/management/v1/azure.pb.go b/api/management/v1/azure.pb.go index c523ba94e70..fdd2f154751 100644 --- a/api/management/v1/azure.pb.go +++ b/api/management/v1/azure.pb.go @@ -7,12 +7,13 @@ package managementv1 import ( - _ "github.com/envoyproxy/protoc-gen-validate/validate" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -698,17 +699,20 @@ func file_management_v1_azure_proto_rawDescGZIP() []byte { return file_management_v1_azure_proto_rawDescData } -var file_management_v1_azure_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_management_v1_azure_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_management_v1_azure_proto_goTypes = []any{ - (DiscoverAzureDatabaseType)(0), // 0: management.v1.DiscoverAzureDatabaseType - (*DiscoverAzureDatabaseRequest)(nil), // 1: management.v1.DiscoverAzureDatabaseRequest - (*DiscoverAzureDatabaseInstance)(nil), // 2: management.v1.DiscoverAzureDatabaseInstance - (*DiscoverAzureDatabaseResponse)(nil), // 3: management.v1.DiscoverAzureDatabaseResponse - (*AddAzureDatabaseRequest)(nil), // 4: management.v1.AddAzureDatabaseRequest - (*AddAzureDatabaseResponse)(nil), // 5: management.v1.AddAzureDatabaseResponse - nil, // 6: management.v1.AddAzureDatabaseRequest.CustomLabelsEntry -} +var ( + file_management_v1_azure_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_management_v1_azure_proto_msgTypes = make([]protoimpl.MessageInfo, 6) + file_management_v1_azure_proto_goTypes = []any{ + (DiscoverAzureDatabaseType)(0), // 0: management.v1.DiscoverAzureDatabaseType + (*DiscoverAzureDatabaseRequest)(nil), // 1: management.v1.DiscoverAzureDatabaseRequest + (*DiscoverAzureDatabaseInstance)(nil), // 2: management.v1.DiscoverAzureDatabaseInstance + (*DiscoverAzureDatabaseResponse)(nil), // 3: management.v1.DiscoverAzureDatabaseResponse + (*AddAzureDatabaseRequest)(nil), // 4: management.v1.AddAzureDatabaseRequest + (*AddAzureDatabaseResponse)(nil), // 5: management.v1.AddAzureDatabaseResponse + nil, // 6: management.v1.AddAzureDatabaseRequest.CustomLabelsEntry + } +) + var file_management_v1_azure_proto_depIdxs = []int32{ 0, // 0: management.v1.DiscoverAzureDatabaseInstance.type:type_name -> management.v1.DiscoverAzureDatabaseType 2, // 1: management.v1.DiscoverAzureDatabaseResponse.azure_database_instance:type_name -> management.v1.DiscoverAzureDatabaseInstance diff --git a/api/management/v1/azure.swagger.json b/api/management/v1/azure.swagger.json deleted file mode 100644 index 83b5bc19d33..00000000000 --- a/api/management/v1/azure.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/azure.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/management/v1/external.pb.go b/api/management/v1/external.pb.go index 4585b95173f..1f2612371ce 100644 --- a/api/management/v1/external.pb.go +++ b/api/management/v1/external.pb.go @@ -7,13 +7,15 @@ package managementv1 import ( - _ "github.com/envoyproxy/protoc-gen-validate/validate" - v1 "github.com/percona/pmm/api/inventory/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -340,16 +342,19 @@ func file_management_v1_external_proto_rawDescGZIP() []byte { return file_management_v1_external_proto_rawDescData } -var file_management_v1_external_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_management_v1_external_proto_goTypes = []any{ - (*AddExternalServiceParams)(nil), // 0: management.v1.AddExternalServiceParams - (*ExternalServiceResult)(nil), // 1: management.v1.ExternalServiceResult - nil, // 2: management.v1.AddExternalServiceParams.CustomLabelsEntry - (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams - (MetricsMode)(0), // 4: management.v1.MetricsMode - (*v1.ExternalService)(nil), // 5: inventory.v1.ExternalService - (*v1.ExternalExporter)(nil), // 6: inventory.v1.ExternalExporter -} +var ( + file_management_v1_external_proto_msgTypes = make([]protoimpl.MessageInfo, 3) + file_management_v1_external_proto_goTypes = []any{ + (*AddExternalServiceParams)(nil), // 0: management.v1.AddExternalServiceParams + (*ExternalServiceResult)(nil), // 1: management.v1.ExternalServiceResult + nil, // 2: management.v1.AddExternalServiceParams.CustomLabelsEntry + (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams + (MetricsMode)(0), // 4: management.v1.MetricsMode + (*v1.ExternalService)(nil), // 5: inventory.v1.ExternalService + (*v1.ExternalExporter)(nil), // 6: inventory.v1.ExternalExporter + } +) + var file_management_v1_external_proto_depIdxs = []int32{ 3, // 0: management.v1.AddExternalServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddExternalServiceParams.custom_labels:type_name -> management.v1.AddExternalServiceParams.CustomLabelsEntry diff --git a/api/management/v1/external.swagger.json b/api/management/v1/external.swagger.json deleted file mode 100644 index ee98890ec3a..00000000000 --- a/api/management/v1/external.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/external.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/management/v1/haproxy.pb.go b/api/management/v1/haproxy.pb.go index 662b9422e42..06b4c664762 100644 --- a/api/management/v1/haproxy.pb.go +++ b/api/management/v1/haproxy.pb.go @@ -7,13 +7,15 @@ package managementv1 import ( - _ "github.com/envoyproxy/protoc-gen-validate/validate" - v1 "github.com/percona/pmm/api/inventory/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -318,16 +320,19 @@ func file_management_v1_haproxy_proto_rawDescGZIP() []byte { return file_management_v1_haproxy_proto_rawDescData } -var file_management_v1_haproxy_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_management_v1_haproxy_proto_goTypes = []any{ - (*AddHAProxyServiceParams)(nil), // 0: management.v1.AddHAProxyServiceParams - (*HAProxyServiceResult)(nil), // 1: management.v1.HAProxyServiceResult - nil, // 2: management.v1.AddHAProxyServiceParams.CustomLabelsEntry - (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams - (MetricsMode)(0), // 4: management.v1.MetricsMode - (*v1.HAProxyService)(nil), // 5: inventory.v1.HAProxyService - (*v1.ExternalExporter)(nil), // 6: inventory.v1.ExternalExporter -} +var ( + file_management_v1_haproxy_proto_msgTypes = make([]protoimpl.MessageInfo, 3) + file_management_v1_haproxy_proto_goTypes = []any{ + (*AddHAProxyServiceParams)(nil), // 0: management.v1.AddHAProxyServiceParams + (*HAProxyServiceResult)(nil), // 1: management.v1.HAProxyServiceResult + nil, // 2: management.v1.AddHAProxyServiceParams.CustomLabelsEntry + (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams + (MetricsMode)(0), // 4: management.v1.MetricsMode + (*v1.HAProxyService)(nil), // 5: inventory.v1.HAProxyService + (*v1.ExternalExporter)(nil), // 6: inventory.v1.ExternalExporter + } +) + var file_management_v1_haproxy_proto_depIdxs = []int32{ 3, // 0: management.v1.AddHAProxyServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddHAProxyServiceParams.custom_labels:type_name -> management.v1.AddHAProxyServiceParams.CustomLabelsEntry diff --git a/api/management/v1/haproxy.swagger.json b/api/management/v1/haproxy.swagger.json deleted file mode 100644 index 456d36f1f16..00000000000 --- a/api/management/v1/haproxy.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/haproxy.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/management/v1/json/client/management_service/add_annotation_parameters.go b/api/management/v1/json/client/management_service/add_annotation_parameters.go index 68d4bd76539..0a6148e59af 100644 --- a/api/management/v1/json/client/management_service/add_annotation_parameters.go +++ b/api/management/v1/json/client/management_service/add_annotation_parameters.go @@ -60,7 +60,6 @@ AddAnnotationParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type AddAnnotationParams struct { - /* Body. AddAnnotationRequest is a params to add new annotation. @@ -133,7 +132,6 @@ func (o *AddAnnotationParams) SetBody(body AddAnnotationBody) { // WriteToRequest writes these params to a swagger request func (o *AddAnnotationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/add_annotation_responses.go b/api/management/v1/json/client/management_service/add_annotation_responses.go index ad0abf531dc..e0707e893c8 100644 --- a/api/management/v1/json/client/management_service/add_annotation_responses.go +++ b/api/management/v1/json/client/management_service/add_annotation_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -24,7 +25,7 @@ type AddAnnotationReader struct { } // ReadResponse reads a server response into the received o. -func (o *AddAnnotationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *AddAnnotationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewAddAnnotationOK() @@ -55,7 +56,7 @@ AddAnnotationOK describes a response with status code 200, with default header v A successful response. */ type AddAnnotationOK struct { - Payload interface{} + Payload any } // IsSuccess returns true when this add annotation Ok response has a 2xx status code @@ -98,14 +99,13 @@ func (o *AddAnnotationOK) String() string { return fmt.Sprintf("[POST /v1/management/annotations][%d] addAnnotationOk %s", 200, payload) } -func (o *AddAnnotationOK) GetPayload() interface{} { +func (o *AddAnnotationOK) GetPayload() any { return o.Payload } func (o *AddAnnotationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -175,11 +175,10 @@ func (o *AddAnnotationDefault) GetPayload() *AddAnnotationDefaultBody { } func (o *AddAnnotationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(AddAnnotationDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -191,7 +190,6 @@ AddAnnotationBody AddAnnotationRequest is a params to add new annotation. swagger:model AddAnnotationBody */ type AddAnnotationBody struct { - // An annotation description. Required. Text string `json:"text,omitempty"` @@ -238,7 +236,6 @@ AddAnnotationDefaultBody add annotation default body swagger:model AddAnnotationDefaultBody */ type AddAnnotationDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -275,11 +272,15 @@ func (o *AddAnnotationDefaultBody) validateDetails(formats strfmt.Registry) erro if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -304,9 +305,7 @@ func (o *AddAnnotationDefaultBody) ContextValidate(ctx context.Context, formats } func (o *AddAnnotationDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -314,15 +313,18 @@ func (o *AddAnnotationDefaultBody) contextValidateDetails(ctx context.Context, f } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -351,19 +353,17 @@ AddAnnotationDefaultBodyDetailsItems0 add annotation default body details items0 swagger:model AddAnnotationDefaultBodyDetailsItems0 */ type AddAnnotationDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // add annotation default body details items0 - AddAnnotationDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + AddAnnotationDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *AddAnnotationDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -384,9 +384,9 @@ func (o *AddAnnotationDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -401,7 +401,6 @@ func (o *AddAnnotationDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error // MarshalJSON marshals this object with additional properties into a JSON object func (o AddAnnotationDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } diff --git a/api/management/v1/json/client/management_service/add_azure_database_parameters.go b/api/management/v1/json/client/management_service/add_azure_database_parameters.go index 1fd8c87b5db..b9e1d96ff02 100644 --- a/api/management/v1/json/client/management_service/add_azure_database_parameters.go +++ b/api/management/v1/json/client/management_service/add_azure_database_parameters.go @@ -60,7 +60,6 @@ AddAzureDatabaseParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type AddAzureDatabaseParams struct { - // Body. Body AddAzureDatabaseBody @@ -130,7 +129,6 @@ func (o *AddAzureDatabaseParams) SetBody(body AddAzureDatabaseBody) { // WriteToRequest writes these params to a swagger request func (o *AddAzureDatabaseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/add_azure_database_responses.go b/api/management/v1/json/client/management_service/add_azure_database_responses.go index 4f846697436..947f66d7e84 100644 --- a/api/management/v1/json/client/management_service/add_azure_database_responses.go +++ b/api/management/v1/json/client/management_service/add_azure_database_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +26,7 @@ type AddAzureDatabaseReader struct { } // ReadResponse reads a server response into the received o. -func (o *AddAzureDatabaseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *AddAzureDatabaseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewAddAzureDatabaseOK() @@ -56,7 +57,7 @@ AddAzureDatabaseOK describes a response with status code 200, with default heade A successful response. */ type AddAzureDatabaseOK struct { - Payload interface{} + Payload any } // IsSuccess returns true when this add azure database Ok response has a 2xx status code @@ -99,14 +100,13 @@ func (o *AddAzureDatabaseOK) String() string { return fmt.Sprintf("[POST /v1/management/services/azure][%d] addAzureDatabaseOk %s", 200, payload) } -func (o *AddAzureDatabaseOK) GetPayload() interface{} { +func (o *AddAzureDatabaseOK) GetPayload() any { return o.Payload } func (o *AddAzureDatabaseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -176,11 +176,10 @@ func (o *AddAzureDatabaseDefault) GetPayload() *AddAzureDatabaseDefaultBody { } func (o *AddAzureDatabaseDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(AddAzureDatabaseDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +191,6 @@ AddAzureDatabaseBody add azure database body swagger:model AddAzureDatabaseBody */ type AddAzureDatabaseBody struct { - // Azure database location. Region string `json:"region,omitempty"` @@ -290,7 +288,7 @@ func (o *AddAzureDatabaseBody) Validate(formats strfmt.Registry) error { return nil } -var addAzureDatabaseBodyTypeTypePropEnum []interface{} +var addAzureDatabaseBodyTypeTypePropEnum []any func init() { var res []string @@ -363,7 +361,6 @@ AddAzureDatabaseDefaultBody add azure database default body swagger:model AddAzureDatabaseDefaultBody */ type AddAzureDatabaseDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -400,11 +397,15 @@ func (o *AddAzureDatabaseDefaultBody) validateDetails(formats strfmt.Registry) e if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -429,9 +430,7 @@ func (o *AddAzureDatabaseDefaultBody) ContextValidate(ctx context.Context, forma } func (o *AddAzureDatabaseDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -439,15 +438,18 @@ func (o *AddAzureDatabaseDefaultBody) contextValidateDetails(ctx context.Context } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -476,19 +478,17 @@ AddAzureDatabaseDefaultBodyDetailsItems0 add azure database default body details swagger:model AddAzureDatabaseDefaultBodyDetailsItems0 */ type AddAzureDatabaseDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // add azure database default body details items0 - AddAzureDatabaseDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + AddAzureDatabaseDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *AddAzureDatabaseDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -509,9 +509,9 @@ func (o *AddAzureDatabaseDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) er delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -526,7 +526,6 @@ func (o *AddAzureDatabaseDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) er // MarshalJSON marshals this object with additional properties into a JSON object func (o AddAzureDatabaseDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } diff --git a/api/management/v1/json/client/management_service/add_service_parameters.go b/api/management/v1/json/client/management_service/add_service_parameters.go index 8e80c2a6085..64e2dd78b6b 100644 --- a/api/management/v1/json/client/management_service/add_service_parameters.go +++ b/api/management/v1/json/client/management_service/add_service_parameters.go @@ -60,7 +60,6 @@ AddServiceParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type AddServiceParams struct { - // Body. Body AddServiceBody @@ -130,7 +129,6 @@ func (o *AddServiceParams) SetBody(body AddServiceBody) { // WriteToRequest writes these params to a swagger request func (o *AddServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/add_service_responses.go b/api/management/v1/json/client/management_service/add_service_responses.go index 64f90464ae3..40d004ff770 100644 --- a/api/management/v1/json/client/management_service/add_service_responses.go +++ b/api/management/v1/json/client/management_service/add_service_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +26,7 @@ type AddServiceReader struct { } // ReadResponse reads a server response into the received o. -func (o *AddServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *AddServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewAddServiceOK() @@ -104,11 +105,10 @@ func (o *AddServiceOK) GetPayload() *AddServiceOKBody { } func (o *AddServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(AddServiceOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -178,11 +178,10 @@ func (o *AddServiceDefault) GetPayload() *AddServiceDefaultBody { } func (o *AddServiceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(AddServiceDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -194,7 +193,6 @@ AddServiceBody add service body swagger:model AddServiceBody */ type AddServiceBody struct { - // external External *AddServiceParamsBodyExternal `json:"external,omitempty"` @@ -269,11 +267,15 @@ func (o *AddServiceBody) validateExternal(formats strfmt.Registry) error { if o.External != nil { if err := o.External.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "external") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "external") } + return err } } @@ -288,11 +290,15 @@ func (o *AddServiceBody) validateHaproxy(formats strfmt.Registry) error { if o.Haproxy != nil { if err := o.Haproxy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "haproxy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "haproxy") } + return err } } @@ -307,11 +313,15 @@ func (o *AddServiceBody) validateMongodb(formats strfmt.Registry) error { if o.Mongodb != nil { if err := o.Mongodb.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "mongodb") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "mongodb") } + return err } } @@ -326,11 +336,15 @@ func (o *AddServiceBody) validateMysql(formats strfmt.Registry) error { if o.Mysql != nil { if err := o.Mysql.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "mysql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "mysql") } + return err } } @@ -345,11 +359,15 @@ func (o *AddServiceBody) validatePostgresql(formats strfmt.Registry) error { if o.Postgresql != nil { if err := o.Postgresql.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "postgresql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "postgresql") } + return err } } @@ -364,11 +382,15 @@ func (o *AddServiceBody) validateProxysql(formats strfmt.Registry) error { if o.Proxysql != nil { if err := o.Proxysql.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "proxysql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "proxysql") } + return err } } @@ -383,11 +405,15 @@ func (o *AddServiceBody) validateRDS(formats strfmt.Registry) error { if o.RDS != nil { if err := o.RDS.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "rds") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "rds") } + return err } } @@ -402,11 +428,15 @@ func (o *AddServiceBody) validateValkey(formats strfmt.Registry) error { if o.Valkey != nil { if err := o.Valkey.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "valkey") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "valkey") } + return err } } @@ -457,7 +487,6 @@ func (o *AddServiceBody) ContextValidate(ctx context.Context, formats strfmt.Reg } func (o *AddServiceBody) contextValidateExternal(ctx context.Context, formats strfmt.Registry) error { - if o.External != nil { if swag.IsZero(o.External) { // not required @@ -465,11 +494,15 @@ func (o *AddServiceBody) contextValidateExternal(ctx context.Context, formats st } if err := o.External.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "external") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "external") } + return err } } @@ -478,7 +511,6 @@ func (o *AddServiceBody) contextValidateExternal(ctx context.Context, formats st } func (o *AddServiceBody) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { - if o.Haproxy != nil { if swag.IsZero(o.Haproxy) { // not required @@ -486,11 +518,15 @@ func (o *AddServiceBody) contextValidateHaproxy(ctx context.Context, formats str } if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "haproxy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "haproxy") } + return err } } @@ -499,7 +535,6 @@ func (o *AddServiceBody) contextValidateHaproxy(ctx context.Context, formats str } func (o *AddServiceBody) contextValidateMongodb(ctx context.Context, formats strfmt.Registry) error { - if o.Mongodb != nil { if swag.IsZero(o.Mongodb) { // not required @@ -507,11 +542,15 @@ func (o *AddServiceBody) contextValidateMongodb(ctx context.Context, formats str } if err := o.Mongodb.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "mongodb") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "mongodb") } + return err } } @@ -520,7 +559,6 @@ func (o *AddServiceBody) contextValidateMongodb(ctx context.Context, formats str } func (o *AddServiceBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { - if o.Mysql != nil { if swag.IsZero(o.Mysql) { // not required @@ -528,11 +566,15 @@ func (o *AddServiceBody) contextValidateMysql(ctx context.Context, formats strfm } if err := o.Mysql.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "mysql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "mysql") } + return err } } @@ -541,7 +583,6 @@ func (o *AddServiceBody) contextValidateMysql(ctx context.Context, formats strfm } func (o *AddServiceBody) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { - if o.Postgresql != nil { if swag.IsZero(o.Postgresql) { // not required @@ -549,11 +590,15 @@ func (o *AddServiceBody) contextValidatePostgresql(ctx context.Context, formats } if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "postgresql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "postgresql") } + return err } } @@ -562,7 +607,6 @@ func (o *AddServiceBody) contextValidatePostgresql(ctx context.Context, formats } func (o *AddServiceBody) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { - if o.Proxysql != nil { if swag.IsZero(o.Proxysql) { // not required @@ -570,11 +614,15 @@ func (o *AddServiceBody) contextValidateProxysql(ctx context.Context, formats st } if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "proxysql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "proxysql") } + return err } } @@ -583,7 +631,6 @@ func (o *AddServiceBody) contextValidateProxysql(ctx context.Context, formats st } func (o *AddServiceBody) contextValidateRDS(ctx context.Context, formats strfmt.Registry) error { - if o.RDS != nil { if swag.IsZero(o.RDS) { // not required @@ -591,11 +638,15 @@ func (o *AddServiceBody) contextValidateRDS(ctx context.Context, formats strfmt. } if err := o.RDS.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "rds") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "rds") } + return err } } @@ -604,7 +655,6 @@ func (o *AddServiceBody) contextValidateRDS(ctx context.Context, formats strfmt. } func (o *AddServiceBody) contextValidateValkey(ctx context.Context, formats strfmt.Registry) error { - if o.Valkey != nil { if swag.IsZero(o.Valkey) { // not required @@ -612,11 +662,15 @@ func (o *AddServiceBody) contextValidateValkey(ctx context.Context, formats strf } if err := o.Valkey.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "valkey") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "valkey") } + return err } } @@ -647,7 +701,6 @@ AddServiceDefaultBody add service default body swagger:model AddServiceDefaultBody */ type AddServiceDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -684,11 +737,15 @@ func (o *AddServiceDefaultBody) validateDetails(formats strfmt.Registry) error { if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -713,9 +770,7 @@ func (o *AddServiceDefaultBody) ContextValidate(ctx context.Context, formats str } func (o *AddServiceDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -723,15 +778,18 @@ func (o *AddServiceDefaultBody) contextValidateDetails(ctx context.Context, form } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -760,19 +818,17 @@ AddServiceDefaultBodyDetailsItems0 add service default body details items0 swagger:model AddServiceDefaultBodyDetailsItems0 */ type AddServiceDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // add service default body details items0 - AddServiceDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + AddServiceDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *AddServiceDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -793,9 +849,9 @@ func (o *AddServiceDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -810,7 +866,6 @@ func (o *AddServiceDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // MarshalJSON marshals this object with additional properties into a JSON object func (o AddServiceDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -874,7 +929,6 @@ AddServiceOKBody add service OK body swagger:model AddServiceOKBody */ type AddServiceOKBody struct { - // external External *AddServiceOKBodyExternal `json:"external,omitempty"` @@ -949,11 +1003,15 @@ func (o *AddServiceOKBody) validateExternal(formats strfmt.Registry) error { if o.External != nil { if err := o.External.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "external") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "external") } + return err } } @@ -968,11 +1026,15 @@ func (o *AddServiceOKBody) validateHaproxy(formats strfmt.Registry) error { if o.Haproxy != nil { if err := o.Haproxy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "haproxy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "haproxy") } + return err } } @@ -987,11 +1049,15 @@ func (o *AddServiceOKBody) validateMongodb(formats strfmt.Registry) error { if o.Mongodb != nil { if err := o.Mongodb.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb") } + return err } } @@ -1006,11 +1072,15 @@ func (o *AddServiceOKBody) validateMysql(formats strfmt.Registry) error { if o.Mysql != nil { if err := o.Mysql.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mysql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mysql") } + return err } } @@ -1025,11 +1095,15 @@ func (o *AddServiceOKBody) validatePostgresql(formats strfmt.Registry) error { if o.Postgresql != nil { if err := o.Postgresql.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "postgresql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "postgresql") } + return err } } @@ -1044,11 +1118,15 @@ func (o *AddServiceOKBody) validateProxysql(formats strfmt.Registry) error { if o.Proxysql != nil { if err := o.Proxysql.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "proxysql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "proxysql") } + return err } } @@ -1063,11 +1141,15 @@ func (o *AddServiceOKBody) validateRDS(formats strfmt.Registry) error { if o.RDS != nil { if err := o.RDS.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds") } + return err } } @@ -1082,11 +1164,15 @@ func (o *AddServiceOKBody) validateValkey(formats strfmt.Registry) error { if o.Valkey != nil { if err := o.Valkey.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "valkey") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "valkey") } + return err } } @@ -1137,7 +1223,6 @@ func (o *AddServiceOKBody) ContextValidate(ctx context.Context, formats strfmt.R } func (o *AddServiceOKBody) contextValidateExternal(ctx context.Context, formats strfmt.Registry) error { - if o.External != nil { if swag.IsZero(o.External) { // not required @@ -1145,11 +1230,15 @@ func (o *AddServiceOKBody) contextValidateExternal(ctx context.Context, formats } if err := o.External.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "external") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "external") } + return err } } @@ -1158,7 +1247,6 @@ func (o *AddServiceOKBody) contextValidateExternal(ctx context.Context, formats } func (o *AddServiceOKBody) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { - if o.Haproxy != nil { if swag.IsZero(o.Haproxy) { // not required @@ -1166,11 +1254,15 @@ func (o *AddServiceOKBody) contextValidateHaproxy(ctx context.Context, formats s } if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "haproxy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "haproxy") } + return err } } @@ -1179,7 +1271,6 @@ func (o *AddServiceOKBody) contextValidateHaproxy(ctx context.Context, formats s } func (o *AddServiceOKBody) contextValidateMongodb(ctx context.Context, formats strfmt.Registry) error { - if o.Mongodb != nil { if swag.IsZero(o.Mongodb) { // not required @@ -1187,11 +1278,15 @@ func (o *AddServiceOKBody) contextValidateMongodb(ctx context.Context, formats s } if err := o.Mongodb.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb") } + return err } } @@ -1200,7 +1295,6 @@ func (o *AddServiceOKBody) contextValidateMongodb(ctx context.Context, formats s } func (o *AddServiceOKBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { - if o.Mysql != nil { if swag.IsZero(o.Mysql) { // not required @@ -1208,11 +1302,15 @@ func (o *AddServiceOKBody) contextValidateMysql(ctx context.Context, formats str } if err := o.Mysql.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mysql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mysql") } + return err } } @@ -1221,7 +1319,6 @@ func (o *AddServiceOKBody) contextValidateMysql(ctx context.Context, formats str } func (o *AddServiceOKBody) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { - if o.Postgresql != nil { if swag.IsZero(o.Postgresql) { // not required @@ -1229,11 +1326,15 @@ func (o *AddServiceOKBody) contextValidatePostgresql(ctx context.Context, format } if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "postgresql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "postgresql") } + return err } } @@ -1242,7 +1343,6 @@ func (o *AddServiceOKBody) contextValidatePostgresql(ctx context.Context, format } func (o *AddServiceOKBody) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { - if o.Proxysql != nil { if swag.IsZero(o.Proxysql) { // not required @@ -1250,11 +1350,15 @@ func (o *AddServiceOKBody) contextValidateProxysql(ctx context.Context, formats } if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "proxysql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "proxysql") } + return err } } @@ -1263,7 +1367,6 @@ func (o *AddServiceOKBody) contextValidateProxysql(ctx context.Context, formats } func (o *AddServiceOKBody) contextValidateRDS(ctx context.Context, formats strfmt.Registry) error { - if o.RDS != nil { if swag.IsZero(o.RDS) { // not required @@ -1271,11 +1374,15 @@ func (o *AddServiceOKBody) contextValidateRDS(ctx context.Context, formats strfm } if err := o.RDS.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds") } + return err } } @@ -1284,7 +1391,6 @@ func (o *AddServiceOKBody) contextValidateRDS(ctx context.Context, formats strfm } func (o *AddServiceOKBody) contextValidateValkey(ctx context.Context, formats strfmt.Registry) error { - if o.Valkey != nil { if swag.IsZero(o.Valkey) { // not required @@ -1292,11 +1398,15 @@ func (o *AddServiceOKBody) contextValidateValkey(ctx context.Context, formats st } if err := o.Valkey.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "valkey") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "valkey") } + return err } } @@ -1327,7 +1437,6 @@ AddServiceOKBodyExternal add service OK body external swagger:model AddServiceOKBodyExternal */ type AddServiceOKBodyExternal struct { - // external exporter ExternalExporter *AddServiceOKBodyExternalExternalExporter `json:"external_exporter,omitempty"` @@ -1360,11 +1469,15 @@ func (o *AddServiceOKBodyExternal) validateExternalExporter(formats strfmt.Regis if o.ExternalExporter != nil { if err := o.ExternalExporter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter") } + return err } } @@ -1379,11 +1492,15 @@ func (o *AddServiceOKBodyExternal) validateService(formats strfmt.Registry) erro if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "external" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "external" + "." + "service") } + return err } } @@ -1410,7 +1527,6 @@ func (o *AddServiceOKBodyExternal) ContextValidate(ctx context.Context, formats } func (o *AddServiceOKBodyExternal) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ExternalExporter != nil { if swag.IsZero(o.ExternalExporter) { // not required @@ -1418,11 +1534,15 @@ func (o *AddServiceOKBodyExternal) contextValidateExternalExporter(ctx context.C } if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter") } + return err } } @@ -1431,7 +1551,6 @@ func (o *AddServiceOKBodyExternal) contextValidateExternalExporter(ctx context.C } func (o *AddServiceOKBodyExternal) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -1439,11 +1558,15 @@ func (o *AddServiceOKBodyExternal) contextValidateService(ctx context.Context, f } if err := o.Service.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "external" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "external" + "." + "service") } + return err } } @@ -1474,7 +1597,6 @@ AddServiceOKBodyExternalExternalExporter ExternalExporter runs on any Node type, swagger:model AddServiceOKBodyExternalExternalExporter */ type AddServiceOKBodyExternalExternalExporter struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -1511,9 +1633,6 @@ type AddServiceOKBodyExternalExternalExporter struct { // Skip TLS certificate and hostname verification. TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - // metrics resolutions - MetricsResolutions *AddServiceOKBodyExternalExternalExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` - // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -1525,17 +1644,20 @@ type AddServiceOKBodyExternalExternalExporter struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` + + // metrics resolutions + MetricsResolutions *AddServiceOKBodyExternalExternalExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` } // Validate validates this add service OK body external external exporter func (o *AddServiceOKBodyExternalExternalExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } @@ -1545,26 +1667,7 @@ func (o *AddServiceOKBodyExternalExternalExporter) Validate(formats strfmt.Regis return nil } -func (o *AddServiceOKBodyExternalExternalExporter) validateMetricsResolutions(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsResolutions) { // not required - return nil - } - - if o.MetricsResolutions != nil { - if err := o.MetricsResolutions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter" + "." + "metrics_resolutions") - } - return err - } - } - - return nil -} - -var addServiceOkBodyExternalExternalExporterTypeStatusPropEnum []interface{} +var addServiceOkBodyExternalExternalExporterTypeStatusPropEnum []any func init() { var res []string @@ -1624,6 +1727,29 @@ func (o *AddServiceOKBodyExternalExternalExporter) validateStatus(formats strfmt return nil } +func (o *AddServiceOKBodyExternalExternalExporter) validateMetricsResolutions(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsResolutions) { // not required + return nil + } + + if o.MetricsResolutions != nil { + if err := o.MetricsResolutions.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter" + "." + "metrics_resolutions") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter" + "." + "metrics_resolutions") + } + + return err + } + } + + return nil +} + // ContextValidate validate this add service OK body external external exporter based on the context it is used func (o *AddServiceOKBodyExternalExternalExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -1639,7 +1765,6 @@ func (o *AddServiceOKBodyExternalExternalExporter) ContextValidate(ctx context.C } func (o *AddServiceOKBodyExternalExternalExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { - if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -1647,11 +1772,15 @@ func (o *AddServiceOKBodyExternalExternalExporter) contextValidateMetricsResolut } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter" + "." + "metrics_resolutions") } + return err } } @@ -1682,7 +1811,6 @@ AddServiceOKBodyExternalExternalExporterMetricsResolutions MetricsResolutions re swagger:model AddServiceOKBodyExternalExternalExporterMetricsResolutions */ type AddServiceOKBodyExternalExternalExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -1726,7 +1854,6 @@ AddServiceOKBodyExternalService ExternalService represents a generic External se swagger:model AddServiceOKBodyExternalService */ type AddServiceOKBodyExternalService struct { - // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -1791,7 +1918,6 @@ AddServiceOKBodyHaproxy add service OK body haproxy swagger:model AddServiceOKBodyHaproxy */ type AddServiceOKBodyHaproxy struct { - // external exporter ExternalExporter *AddServiceOKBodyHaproxyExternalExporter `json:"external_exporter,omitempty"` @@ -1824,11 +1950,15 @@ func (o *AddServiceOKBodyHaproxy) validateExternalExporter(formats strfmt.Regist if o.ExternalExporter != nil { if err := o.ExternalExporter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter") } + return err } } @@ -1843,11 +1973,15 @@ func (o *AddServiceOKBodyHaproxy) validateService(formats strfmt.Registry) error if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "service") } + return err } } @@ -1874,7 +2008,6 @@ func (o *AddServiceOKBodyHaproxy) ContextValidate(ctx context.Context, formats s } func (o *AddServiceOKBodyHaproxy) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ExternalExporter != nil { if swag.IsZero(o.ExternalExporter) { // not required @@ -1882,11 +2015,15 @@ func (o *AddServiceOKBodyHaproxy) contextValidateExternalExporter(ctx context.Co } if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter") } + return err } } @@ -1895,7 +2032,6 @@ func (o *AddServiceOKBodyHaproxy) contextValidateExternalExporter(ctx context.Co } func (o *AddServiceOKBodyHaproxy) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -1903,11 +2039,15 @@ func (o *AddServiceOKBodyHaproxy) contextValidateService(ctx context.Context, fo } if err := o.Service.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "service") } + return err } } @@ -1938,7 +2078,6 @@ AddServiceOKBodyHaproxyExternalExporter ExternalExporter runs on any Node type, swagger:model AddServiceOKBodyHaproxyExternalExporter */ type AddServiceOKBodyHaproxyExternalExporter struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -1975,9 +2114,6 @@ type AddServiceOKBodyHaproxyExternalExporter struct { // Skip TLS certificate and hostname verification. TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - // metrics resolutions - MetricsResolutions *AddServiceOKBodyHaproxyExternalExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` - // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -1989,17 +2125,20 @@ type AddServiceOKBodyHaproxyExternalExporter struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` + + // metrics resolutions + MetricsResolutions *AddServiceOKBodyHaproxyExternalExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` } // Validate validates this add service OK body haproxy external exporter func (o *AddServiceOKBodyHaproxyExternalExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } @@ -2009,26 +2148,7 @@ func (o *AddServiceOKBodyHaproxyExternalExporter) Validate(formats strfmt.Regist return nil } -func (o *AddServiceOKBodyHaproxyExternalExporter) validateMetricsResolutions(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsResolutions) { // not required - return nil - } - - if o.MetricsResolutions != nil { - if err := o.MetricsResolutions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter" + "." + "metrics_resolutions") - } - return err - } - } - - return nil -} - -var addServiceOkBodyHaproxyExternalExporterTypeStatusPropEnum []interface{} +var addServiceOkBodyHaproxyExternalExporterTypeStatusPropEnum []any func init() { var res []string @@ -2088,6 +2208,29 @@ func (o *AddServiceOKBodyHaproxyExternalExporter) validateStatus(formats strfmt. return nil } +func (o *AddServiceOKBodyHaproxyExternalExporter) validateMetricsResolutions(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsResolutions) { // not required + return nil + } + + if o.MetricsResolutions != nil { + if err := o.MetricsResolutions.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter" + "." + "metrics_resolutions") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter" + "." + "metrics_resolutions") + } + + return err + } + } + + return nil +} + // ContextValidate validate this add service OK body haproxy external exporter based on the context it is used func (o *AddServiceOKBodyHaproxyExternalExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -2103,7 +2246,6 @@ func (o *AddServiceOKBodyHaproxyExternalExporter) ContextValidate(ctx context.Co } func (o *AddServiceOKBodyHaproxyExternalExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { - if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -2111,11 +2253,15 @@ func (o *AddServiceOKBodyHaproxyExternalExporter) contextValidateMetricsResoluti } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter" + "." + "metrics_resolutions") } + return err } } @@ -2146,7 +2292,6 @@ AddServiceOKBodyHaproxyExternalExporterMetricsResolutions MetricsResolutions rep swagger:model AddServiceOKBodyHaproxyExternalExporterMetricsResolutions */ type AddServiceOKBodyHaproxyExternalExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -2190,7 +2335,6 @@ AddServiceOKBodyHaproxyService HAProxyService represents a generic HAProxy servi swagger:model AddServiceOKBodyHaproxyService */ type AddServiceOKBodyHaproxyService struct { - // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -2246,7 +2390,6 @@ AddServiceOKBodyMongodb add service OK body mongodb swagger:model AddServiceOKBodyMongodb */ type AddServiceOKBodyMongodb struct { - // mongodb exporter MongodbExporter *AddServiceOKBodyMongodbMongodbExporter `json:"mongodb_exporter,omitempty"` @@ -2300,11 +2443,15 @@ func (o *AddServiceOKBodyMongodb) validateMongodbExporter(formats strfmt.Registr if o.MongodbExporter != nil { if err := o.MongodbExporter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter") } + return err } } @@ -2319,11 +2466,15 @@ func (o *AddServiceOKBodyMongodb) validateQANMongodbMongolog(formats strfmt.Regi if o.QANMongodbMongolog != nil { if err := o.QANMongodbMongolog.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_mongolog") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_mongolog") } + return err } } @@ -2338,11 +2489,15 @@ func (o *AddServiceOKBodyMongodb) validateQANMongodbProfiler(formats strfmt.Regi if o.QANMongodbProfiler != nil { if err := o.QANMongodbProfiler.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_profiler") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_profiler") } + return err } } @@ -2357,11 +2512,15 @@ func (o *AddServiceOKBodyMongodb) validateRtaMongodbAgent(formats strfmt.Registr if o.RtaMongodbAgent != nil { if err := o.RtaMongodbAgent.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent") } + return err } } @@ -2376,11 +2535,15 @@ func (o *AddServiceOKBodyMongodb) validateService(formats strfmt.Registry) error if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "service") } + return err } } @@ -2419,7 +2582,6 @@ func (o *AddServiceOKBodyMongodb) ContextValidate(ctx context.Context, formats s } func (o *AddServiceOKBodyMongodb) contextValidateMongodbExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MongodbExporter != nil { if swag.IsZero(o.MongodbExporter) { // not required @@ -2427,11 +2589,15 @@ func (o *AddServiceOKBodyMongodb) contextValidateMongodbExporter(ctx context.Con } if err := o.MongodbExporter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter") } + return err } } @@ -2440,7 +2606,6 @@ func (o *AddServiceOKBodyMongodb) contextValidateMongodbExporter(ctx context.Con } func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbMongolog(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbMongolog != nil { if swag.IsZero(o.QANMongodbMongolog) { // not required @@ -2448,11 +2613,15 @@ func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbMongolog(ctx context. } if err := o.QANMongodbMongolog.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_mongolog") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_mongolog") } + return err } } @@ -2461,7 +2630,6 @@ func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbMongolog(ctx context. } func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbProfiler(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbProfiler != nil { if swag.IsZero(o.QANMongodbProfiler) { // not required @@ -2469,11 +2637,15 @@ func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbProfiler(ctx context. } if err := o.QANMongodbProfiler.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_profiler") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_profiler") } + return err } } @@ -2482,7 +2654,6 @@ func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbProfiler(ctx context. } func (o *AddServiceOKBodyMongodb) contextValidateRtaMongodbAgent(ctx context.Context, formats strfmt.Registry) error { - if o.RtaMongodbAgent != nil { if swag.IsZero(o.RtaMongodbAgent) { // not required @@ -2490,11 +2661,15 @@ func (o *AddServiceOKBodyMongodb) contextValidateRtaMongodbAgent(ctx context.Con } if err := o.RtaMongodbAgent.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent") } + return err } } @@ -2503,7 +2678,6 @@ func (o *AddServiceOKBodyMongodb) contextValidateRtaMongodbAgent(ctx context.Con } func (o *AddServiceOKBodyMongodb) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -2511,11 +2685,15 @@ func (o *AddServiceOKBodyMongodb) contextValidateService(ctx context.Context, fo } if err := o.Service.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "service") } + return err } } @@ -2546,7 +2724,6 @@ AddServiceOKBodyMongodbMongodbExporter MongoDBExporter runs on Generic or Contai swagger:model AddServiceOKBodyMongodbMongodbExporter */ type AddServiceOKBodyMongodbMongodbExporter struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -2577,14 +2754,26 @@ type AddServiceOKBodyMongodbMongodbExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` - - // List of colletions to get stats from. Can use * - StatsCollections []string `json:"stats_collections"` - - // Collections limit. Only get Databases and collection stats if the total number of collections in the server - // is less than this value. 0: no limit + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` + + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + + // List of colletions to get stats from. Can use * + StatsCollections []string `json:"stats_collections"` + + // Collections limit. Only get Databases and collection stats if the total number of collections in the server + // is less than this value. 0: no limit CollectionsLimit int32 `json:"collections_limit,omitempty"` // Enable all collectors. @@ -2593,47 +2782,35 @@ type AddServiceOKBodyMongodbMongodbExporter struct { // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // Environment variable names passed to the exporter. - EnvironmentVariableNames []string `json:"environment_variable_names"` - // Log level for exporters // // - LOG_LEVEL_UNSPECIFIED: Auto // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] LogLevel *string `json:"log_level,omitempty"` + // Optionally expose the exporter process on all public interfaces + ExposeExporter bool `json:"expose_exporter,omitempty"` + + // Environment variable names passed to the exporter. + EnvironmentVariableNames []string `json:"environment_variable_names"` + // metrics resolutions MetricsResolutions *AddServiceOKBodyMongodbMongodbExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` - - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` } // Validate validates this add service OK body mongodb mongodb exporter func (o *AddServiceOKBodyMongodbMongodbExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } @@ -2643,7 +2820,67 @@ func (o *AddServiceOKBodyMongodbMongodbExporter) Validate(formats strfmt.Registr return nil } -var addServiceOkBodyMongodbMongodbExporterTypeLogLevelPropEnum []interface{} +var addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum = append(addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyMongodbMongodbExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyMongodbMongodbExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"mongodb_exporter"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + +var addServiceOkBodyMongodbMongodbExporterTypeLogLevelPropEnum []any func init() { var res []string @@ -2704,11 +2941,15 @@ func (o *AddServiceOKBodyMongodbMongodbExporter) validateMetricsResolutions(form if o.MetricsResolutions != nil { if err := o.MetricsResolutions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter" + "." + "metrics_resolutions") } + return err } } @@ -2716,66 +2957,6 @@ func (o *AddServiceOKBodyMongodbMongodbExporter) validateMetricsResolutions(form return nil } -var addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum = append(addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyMongodbMongodbExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyMongodbMongodbExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbMongodbExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyMongodbMongodbExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"mongodb_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - // ContextValidate validate this add service OK body mongodb mongodb exporter based on the context it is used func (o *AddServiceOKBodyMongodbMongodbExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -2791,7 +2972,6 @@ func (o *AddServiceOKBodyMongodbMongodbExporter) ContextValidate(ctx context.Con } func (o *AddServiceOKBodyMongodbMongodbExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { - if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -2799,11 +2979,15 @@ func (o *AddServiceOKBodyMongodbMongodbExporter) contextValidateMetricsResolutio } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter" + "." + "metrics_resolutions") } + return err } } @@ -2834,7 +3018,6 @@ AddServiceOKBodyMongodbMongodbExporterMetricsResolutions MetricsResolutions repr swagger:model AddServiceOKBodyMongodbMongodbExporterMetricsResolutions */ type AddServiceOKBodyMongodbMongodbExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -2878,7 +3061,6 @@ AddServiceOKBodyMongodbQANMongodbMongolog QANMongoDBMongologAgent runs within pm swagger:model AddServiceOKBodyMongodbQANMongodbMongolog */ type AddServiceOKBodyMongodbQANMongodbMongolog struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -2906,15 +3088,6 @@ type AddServiceOKBodyMongodbQANMongodbMongolog struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -2926,17 +3099,26 @@ type AddServiceOKBodyMongodbQANMongodbMongolog struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` + + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` } // Validate validates this add service OK body mongodb QAN mongodb mongolog func (o *AddServiceOKBodyMongodbQANMongodbMongolog) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } @@ -2946,61 +3128,7 @@ func (o *AddServiceOKBodyMongodbQANMongodbMongolog) Validate(formats strfmt.Regi return nil } -var addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum = append(addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceOKBodyMongodbQANMongodbMongolog) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyMongodbQANMongodbMongolog) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_mongolog"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyMongodbQanMongodbMongologTypeStatusPropEnum []interface{} +var addServiceOkBodyMongodbQanMongodbMongologTypeStatusPropEnum []any func init() { var res []string @@ -3060,13 +3188,67 @@ func (o *AddServiceOKBodyMongodbQANMongodbMongolog) validateStatus(formats strfm return nil } -// ContextValidate validates this add service OK body mongodb QAN mongodb mongolog based on context it is used -func (o *AddServiceOKBodyMongodbQANMongodbMongolog) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} +var addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum []any -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMongodbQANMongodbMongolog) MarshalBinary() ([]byte, error) { +func init() { + var res []string + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum = append(addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + + // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + + // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + + // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + + // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + + // AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyMongodbQANMongodbMongologLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" +) + +// prop value enum +func (o *AddServiceOKBodyMongodbQANMongodbMongolog) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyMongodbQANMongodbMongolog) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required + return nil + } + + // value enum + if err := o.validateLogLevelEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_mongolog"+"."+"log_level", "body", *o.LogLevel); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this add service OK body mongodb QAN mongodb mongolog based on context it is used +func (o *AddServiceOKBodyMongodbQANMongodbMongolog) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddServiceOKBodyMongodbQANMongodbMongolog) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -3088,7 +3270,6 @@ AddServiceOKBodyMongodbQANMongodbProfiler QANMongoDBProfilerAgent runs within pm swagger:model AddServiceOKBodyMongodbQANMongodbProfiler */ type AddServiceOKBodyMongodbQANMongodbProfiler struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -3116,15 +3297,6 @@ type AddServiceOKBodyMongodbQANMongodbProfiler struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -3136,17 +3308,26 @@ type AddServiceOKBodyMongodbQANMongodbProfiler struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` + + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` } // Validate validates this add service OK body mongodb QAN mongodb profiler func (o *AddServiceOKBodyMongodbQANMongodbProfiler) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } @@ -3156,114 +3337,114 @@ func (o *AddServiceOKBodyMongodbQANMongodbProfiler) Validate(formats strfmt.Regi return nil } -var addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum []interface{} +var addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum = append(addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum, v) + addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum = append(addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" ) // prop value enum -func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum, true); err != nil { +func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required +func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_profiler"+"."+"log_level", "body", *o.LogLevel); err != nil { + if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_profiler"+"."+"status", "body", *o.Status); err != nil { return err } return nil } -var addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum []interface{} +var addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum = append(addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum, v) + addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum = append(addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyMongodbQANMongodbProfiler) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_profiler"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_profiler"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } @@ -3298,7 +3479,6 @@ AddServiceOKBodyMongodbRtaMongodbAgent RTAMongoDBAgent runs within pmm-agent and swagger:model AddServiceOKBodyMongodbRtaMongodbAgent */ type AddServiceOKBodyMongodbRtaMongodbAgent struct { - // Unique agent identifier. AgentID string `json:"agent_id,omitempty"` @@ -3323,15 +3503,6 @@ type AddServiceOKBodyMongodbRtaMongodbAgent struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - - // rta options - RtaOptions *AddServiceOKBodyMongodbRtaMongodbAgentRtaOptions `json:"rta_options,omitempty"` - // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -3343,21 +3514,30 @@ type AddServiceOKBodyMongodbRtaMongodbAgent struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + + // rta options + RtaOptions *AddServiceOKBodyMongodbRtaMongodbAgentRtaOptions `json:"rta_options,omitempty"` } // Validate validates this add service OK body mongodb rta mongodb agent func (o *AddServiceOKBodyMongodbRtaMongodbAgent) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateRtaOptions(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateRtaOptions(formats); err != nil { res = append(res, err) } @@ -3367,7 +3547,67 @@ func (o *AddServiceOKBodyMongodbRtaMongodbAgent) Validate(formats strfmt.Registr return nil } -var addServiceOkBodyMongodbRtaMongodbAgentTypeLogLevelPropEnum []interface{} +var addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum = append(addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyMongodbRtaMongodbAgent) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyMongodbRtaMongodbAgent) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"rta_mongodb_agent"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + +var addServiceOkBodyMongodbRtaMongodbAgentTypeLogLevelPropEnum []any func init() { var res []string @@ -3428,11 +3668,15 @@ func (o *AddServiceOKBodyMongodbRtaMongodbAgent) validateRtaOptions(formats strf if o.RtaOptions != nil { if err := o.RtaOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent" + "." + "rta_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent" + "." + "rta_options") } + return err } } @@ -3440,66 +3684,6 @@ func (o *AddServiceOKBodyMongodbRtaMongodbAgent) validateRtaOptions(formats strf return nil } -var addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum = append(addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyMongodbRtaMongodbAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyMongodbRtaMongodbAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbRtaMongodbAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyMongodbRtaMongodbAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"rta_mongodb_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - // ContextValidate validate this add service OK body mongodb rta mongodb agent based on the context it is used func (o *AddServiceOKBodyMongodbRtaMongodbAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -3515,7 +3699,6 @@ func (o *AddServiceOKBodyMongodbRtaMongodbAgent) ContextValidate(ctx context.Con } func (o *AddServiceOKBodyMongodbRtaMongodbAgent) contextValidateRtaOptions(ctx context.Context, formats strfmt.Registry) error { - if o.RtaOptions != nil { if swag.IsZero(o.RtaOptions) { // not required @@ -3523,11 +3706,15 @@ func (o *AddServiceOKBodyMongodbRtaMongodbAgent) contextValidateRtaOptions(ctx c } if err := o.RtaOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent" + "." + "rta_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "rta_mongodb_agent" + "." + "rta_options") } + return err } } @@ -3558,7 +3745,6 @@ AddServiceOKBodyMongodbRtaMongodbAgentRtaOptions RTAOptions holds Real-Time Quer swagger:model AddServiceOKBodyMongodbRtaMongodbAgentRtaOptions */ type AddServiceOKBodyMongodbRtaMongodbAgentRtaOptions struct { - // Query collect interval (default 2s is set by server). CollectInterval string `json:"collect_interval,omitempty"` } @@ -3596,7 +3782,6 @@ AddServiceOKBodyMongodbService MongoDBService represents a generic MongoDB insta swagger:model AddServiceOKBodyMongodbService */ type AddServiceOKBodyMongodbService struct { - // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -3667,7 +3852,6 @@ AddServiceOKBodyMysql add service OK body mysql swagger:model AddServiceOKBodyMysql */ type AddServiceOKBodyMysql struct { - // Actual table count at the moment of adding. TableCount int32 `json:"table_count,omitempty"` @@ -3717,11 +3901,15 @@ func (o *AddServiceOKBodyMysql) validateMysqldExporter(formats strfmt.Registry) if o.MysqldExporter != nil { if err := o.MysqldExporter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter") } + return err } } @@ -3736,11 +3924,15 @@ func (o *AddServiceOKBodyMysql) validateQANMysqlPerfschema(formats strfmt.Regist if o.QANMysqlPerfschema != nil { if err := o.QANMysqlPerfschema.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_perfschema") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_perfschema") } + return err } } @@ -3755,11 +3947,15 @@ func (o *AddServiceOKBodyMysql) validateQANMysqlSlowlog(formats strfmt.Registry) if o.QANMysqlSlowlog != nil { if err := o.QANMysqlSlowlog.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_slowlog") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_slowlog") } + return err } } @@ -3774,11 +3970,15 @@ func (o *AddServiceOKBodyMysql) validateService(formats strfmt.Registry) error { if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "service") } + return err } } @@ -3813,7 +4013,6 @@ func (o *AddServiceOKBodyMysql) ContextValidate(ctx context.Context, formats str } func (o *AddServiceOKBodyMysql) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MysqldExporter != nil { if swag.IsZero(o.MysqldExporter) { // not required @@ -3821,11 +4020,15 @@ func (o *AddServiceOKBodyMysql) contextValidateMysqldExporter(ctx context.Contex } if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter") } + return err } } @@ -3834,7 +4037,6 @@ func (o *AddServiceOKBodyMysql) contextValidateMysqldExporter(ctx context.Contex } func (o *AddServiceOKBodyMysql) contextValidateQANMysqlPerfschema(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlPerfschema != nil { if swag.IsZero(o.QANMysqlPerfschema) { // not required @@ -3842,11 +4044,15 @@ func (o *AddServiceOKBodyMysql) contextValidateQANMysqlPerfschema(ctx context.Co } if err := o.QANMysqlPerfschema.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_perfschema") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_perfschema") } + return err } } @@ -3855,7 +4061,6 @@ func (o *AddServiceOKBodyMysql) contextValidateQANMysqlPerfschema(ctx context.Co } func (o *AddServiceOKBodyMysql) contextValidateQANMysqlSlowlog(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlSlowlog != nil { if swag.IsZero(o.QANMysqlSlowlog) { // not required @@ -3863,11 +4068,15 @@ func (o *AddServiceOKBodyMysql) contextValidateQANMysqlSlowlog(ctx context.Conte } if err := o.QANMysqlSlowlog.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_slowlog") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_slowlog") } + return err } } @@ -3876,7 +4085,6 @@ func (o *AddServiceOKBodyMysql) contextValidateQANMysqlSlowlog(ctx context.Conte } func (o *AddServiceOKBodyMysql) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -3884,11 +4092,15 @@ func (o *AddServiceOKBodyMysql) contextValidateService(ctx context.Context, form } if err := o.Service.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "service") } + return err } } @@ -3919,7 +4131,6 @@ AddServiceOKBodyMysqlMysqldExporter MySQLdExporter runs on Generic or Container swagger:model AddServiceOKBodyMysqlMysqldExporter */ type AddServiceOKBodyMysqlMysqldExporter struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -3967,6 +4178,18 @@ type AddServiceOKBodyMysqlMysqldExporter struct { // Actual table count at the moment of adding. TableCount int32 `json:"table_count,omitempty"` + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` + // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` @@ -3976,47 +4199,35 @@ type AddServiceOKBodyMysqlMysqldExporter struct { // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` - // Log level for exporters // // - LOG_LEVEL_UNSPECIFIED: Auto // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] LogLevel *string `json:"log_level,omitempty"` + // Optionally expose the exporter process on all public interfaces + ExposeExporter bool `json:"expose_exporter,omitempty"` + + // Extra DSN parameters for MySQL connection. + ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` + // metrics resolutions MetricsResolutions *AddServiceOKBodyMysqlMysqldExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` - - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` } // Validate validates this add service OK body mysql mysqld exporter func (o *AddServiceOKBodyMysqlMysqldExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } @@ -4026,7 +4237,67 @@ func (o *AddServiceOKBodyMysqlMysqldExporter) Validate(formats strfmt.Registry) return nil } -var addServiceOkBodyMysqlMysqldExporterTypeLogLevelPropEnum []interface{} +var addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum = append(addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyMysqlMysqldExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyMysqlMysqldExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"mysqld_exporter"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + +var addServiceOkBodyMysqlMysqldExporterTypeLogLevelPropEnum []any func init() { var res []string @@ -4087,11 +4358,15 @@ func (o *AddServiceOKBodyMysqlMysqldExporter) validateMetricsResolutions(formats if o.MetricsResolutions != nil { if err := o.MetricsResolutions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter" + "." + "metrics_resolutions") } + return err } } @@ -4099,66 +4374,6 @@ func (o *AddServiceOKBodyMysqlMysqldExporter) validateMetricsResolutions(formats return nil } -var addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum = append(addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyMysqlMysqldExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyMysqlMysqldExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlMysqldExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyMysqlMysqldExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"mysqld_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - // ContextValidate validate this add service OK body mysql mysqld exporter based on the context it is used func (o *AddServiceOKBodyMysqlMysqldExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -4174,7 +4389,6 @@ func (o *AddServiceOKBodyMysqlMysqldExporter) ContextValidate(ctx context.Contex } func (o *AddServiceOKBodyMysqlMysqldExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { - if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -4182,11 +4396,15 @@ func (o *AddServiceOKBodyMysqlMysqldExporter) contextValidateMetricsResolutions( } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter" + "." + "metrics_resolutions") } + return err } } @@ -4217,7 +4435,6 @@ AddServiceOKBodyMysqlMysqldExporterMetricsResolutions MetricsResolutions represe swagger:model AddServiceOKBodyMysqlMysqldExporterMetricsResolutions */ type AddServiceOKBodyMysqlMysqldExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -4261,7 +4478,6 @@ AddServiceOKBodyMysqlQANMysqlPerfschema QANMySQLPerfSchemaAgent runs within pmm- swagger:model AddServiceOKBodyMysqlQANMysqlPerfschema */ type AddServiceOKBodyMysqlQANMysqlPerfschema struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -4304,18 +4520,6 @@ type AddServiceOKBodyMysqlQANMysqlPerfschema struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -4327,17 +4531,29 @@ type AddServiceOKBodyMysqlQANMysqlPerfschema struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` + + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + + // Extra DSN parameters for MySQL connection. + ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` } // Validate validates this add service OK body mysql QAN mysql perfschema func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } @@ -4347,114 +4563,114 @@ func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) Validate(formats strfmt.Regist return nil } -var addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum []interface{} +var addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum = append(addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum, v) + addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum = append(addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" ) // prop value enum -func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum, true); err != nil { +func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required +func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_perfschema"+"."+"log_level", "body", *o.LogLevel); err != nil { + if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_perfschema"+"."+"status", "body", *o.Status); err != nil { return err } return nil } -var addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum []interface{} +var addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum = append(addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum, v) + addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum = append(addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_perfschema"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_perfschema"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } @@ -4489,7 +4705,6 @@ AddServiceOKBodyMysqlQANMysqlSlowlog QANMySQLSlowlogAgent runs within pmm-agent swagger:model AddServiceOKBodyMysqlQANMysqlSlowlog */ type AddServiceOKBodyMysqlQANMysqlSlowlog struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -4535,18 +4750,6 @@ type AddServiceOKBodyMysqlQANMysqlSlowlog struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // mod tidy - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -4558,17 +4761,29 @@ type AddServiceOKBodyMysqlQANMysqlSlowlog struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` + + // mod tidy + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + + // Extra DSN parameters for MySQL connection. + ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` } // Validate validates this add service OK body mysql QAN mysql slowlog func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } @@ -4578,114 +4793,114 @@ func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) Validate(formats strfmt.Registry) return nil } -var addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum []interface{} +var addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum = append(addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum, v) + addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum = append(addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" ) // prop value enum -func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum, true); err != nil { +func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required +func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_slowlog"+"."+"log_level", "body", *o.LogLevel); err != nil { + if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_slowlog"+"."+"status", "body", *o.Status); err != nil { return err } return nil } -var addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum []interface{} +var addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum = append(addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum, v) + addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum = append(addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_slowlog"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_slowlog"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } @@ -4720,7 +4935,6 @@ AddServiceOKBodyMysqlService MySQLService represents a generic MySQL instance. swagger:model AddServiceOKBodyMysqlService */ type AddServiceOKBodyMysqlService struct { - // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -4794,7 +5008,6 @@ AddServiceOKBodyPostgresql add service OK body postgresql swagger:model AddServiceOKBodyPostgresql */ type AddServiceOKBodyPostgresql struct { - // Warning message. Warning string `json:"warning,omitempty"` @@ -4844,11 +5057,15 @@ func (o *AddServiceOKBodyPostgresql) validatePostgresExporter(formats strfmt.Reg if o.PostgresExporter != nil { if err := o.PostgresExporter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter") } + return err } } @@ -4863,11 +5080,15 @@ func (o *AddServiceOKBodyPostgresql) validateQANPostgresqlPgstatementsAgent(form if o.QANPostgresqlPgstatementsAgent != nil { if err := o.QANPostgresqlPgstatementsAgent.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatements_agent") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatements_agent") } + return err } } @@ -4882,11 +5103,15 @@ func (o *AddServiceOKBodyPostgresql) validateQANPostgresqlPgstatmonitorAgent(for if o.QANPostgresqlPgstatmonitorAgent != nil { if err := o.QANPostgresqlPgstatmonitorAgent.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatmonitor_agent") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatmonitor_agent") } + return err } } @@ -4901,11 +5126,15 @@ func (o *AddServiceOKBodyPostgresql) validateService(formats strfmt.Registry) er if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "service") } + return err } } @@ -4940,7 +5169,6 @@ func (o *AddServiceOKBodyPostgresql) ContextValidate(ctx context.Context, format } func (o *AddServiceOKBodyPostgresql) contextValidatePostgresExporter(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresExporter != nil { if swag.IsZero(o.PostgresExporter) { // not required @@ -4948,11 +5176,15 @@ func (o *AddServiceOKBodyPostgresql) contextValidatePostgresExporter(ctx context } if err := o.PostgresExporter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter") } + return err } } @@ -4961,7 +5193,6 @@ func (o *AddServiceOKBodyPostgresql) contextValidatePostgresExporter(ctx context } func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatementsAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatementsAgent != nil { if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required @@ -4969,11 +5200,15 @@ func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatementsAge } if err := o.QANPostgresqlPgstatementsAgent.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatements_agent") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatements_agent") } + return err } } @@ -4982,7 +5217,6 @@ func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatementsAge } func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatmonitorAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatmonitorAgent != nil { if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required @@ -4990,11 +5224,15 @@ func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatmonitorAg } if err := o.QANPostgresqlPgstatmonitorAgent.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatmonitor_agent") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatmonitor_agent") } + return err } } @@ -5003,7 +5241,6 @@ func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatmonitorAg } func (o *AddServiceOKBodyPostgresql) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -5011,11 +5248,15 @@ func (o *AddServiceOKBodyPostgresql) contextValidateService(ctx context.Context, } if err := o.Service.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "service") } + return err } } @@ -5046,7 +5287,6 @@ AddServiceOKBodyPostgresqlPostgresExporter PostgresExporter runs on Generic or C swagger:model AddServiceOKBodyPostgresqlPostgresExporter */ type AddServiceOKBodyPostgresqlPostgresExporter struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -5077,12 +5317,30 @@ type AddServiceOKBodyPostgresqlPostgresExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` - + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` + + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // Limit of databases for auto-discovery. AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` @@ -5092,41 +5350,23 @@ type AddServiceOKBodyPostgresqlPostgresExporter struct { // Maximum number of connections that exporter can open to the database instance. MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // metrics resolutions MetricsResolutions *AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` - - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` } // Validate validates this add service OK body postgresql postgres exporter func (o *AddServiceOKBodyPostgresqlPostgresExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } @@ -5136,7 +5376,67 @@ func (o *AddServiceOKBodyPostgresqlPostgresExporter) Validate(formats strfmt.Reg return nil } -var addServiceOkBodyPostgresqlPostgresExporterTypeLogLevelPropEnum []interface{} +var addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum = append(addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"postgresql"+"."+"postgres_exporter"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + +var addServiceOkBodyPostgresqlPostgresExporterTypeLogLevelPropEnum []any func init() { var res []string @@ -5197,11 +5497,15 @@ func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateMetricsResolutions( if o.MetricsResolutions != nil { if err := o.MetricsResolutions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter" + "." + "metrics_resolutions") } + return err } } @@ -5209,66 +5513,6 @@ func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateMetricsResolutions( return nil } -var addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum = append(addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyPostgresqlPostgresExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlPostgresExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"postgresql"+"."+"postgres_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - // ContextValidate validate this add service OK body postgresql postgres exporter based on the context it is used func (o *AddServiceOKBodyPostgresqlPostgresExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -5284,7 +5528,6 @@ func (o *AddServiceOKBodyPostgresqlPostgresExporter) ContextValidate(ctx context } func (o *AddServiceOKBodyPostgresqlPostgresExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { - if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -5292,11 +5535,15 @@ func (o *AddServiceOKBodyPostgresqlPostgresExporter) contextValidateMetricsResol } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter" + "." + "metrics_resolutions") } + return err } } @@ -5327,7 +5574,6 @@ AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions MetricsResolutions swagger:model AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions */ type AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -5371,7 +5617,6 @@ AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent QANPostgreSQLPgStatemen swagger:model AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent */ type AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -5402,15 +5647,6 @@ type AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -5422,17 +5658,26 @@ type AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` + + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` } // Validate validates this add service OK body postgresql QAN postgresql pgstatements agent func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } @@ -5442,61 +5687,7 @@ func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) Validate(form return nil } -var addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatements_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeStatusPropEnum []interface{} +var addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeStatusPropEnum []any func init() { var res []string @@ -5556,18 +5747,72 @@ func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) validateStatu return nil } -// ContextValidate validates this add service OK body postgresql QAN postgresql pgstatements agent based on context it is used -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} +var addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum []any -// MarshalBinary interface implementation -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} +func init() { + var res []string + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" +) + +// prop value enum +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required + return nil + } + + // value enum + if err := o.validateLogLevelEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatements_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this add service OK body postgresql QAN postgresql pgstatements agent based on context it is used +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} // UnmarshalBinary interface implementation func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) UnmarshalBinary(b []byte) error { @@ -5584,7 +5829,6 @@ AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent QANPostgreSQLPgStatMon swagger:model AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent */ type AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -5618,15 +5862,6 @@ type AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -5638,17 +5873,26 @@ type AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` + + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` } // Validate validates this add service OK body postgresql QAN postgresql pgstatmonitor agent func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } @@ -5658,114 +5902,114 @@ func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) Validate(for return nil } -var addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum []interface{} +var addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, v) + addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" ) // prop value enum -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, true); err != nil { +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { + if err := o.validateStatusEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"status", "body", *o.Status); err != nil { return err } return nil } -var addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum []interface{} +var addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, v) + addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } @@ -5800,7 +6044,6 @@ AddServiceOKBodyPostgresqlService PostgreSQLService represents a generic Postgre swagger:model AddServiceOKBodyPostgresqlService */ type AddServiceOKBodyPostgresqlService struct { - // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -5877,7 +6120,6 @@ AddServiceOKBodyProxysql add service OK body proxysql swagger:model AddServiceOKBodyProxysql */ type AddServiceOKBodyProxysql struct { - // proxysql exporter ProxysqlExporter *AddServiceOKBodyProxysqlProxysqlExporter `json:"proxysql_exporter,omitempty"` @@ -5910,11 +6152,15 @@ func (o *AddServiceOKBodyProxysql) validateProxysqlExporter(formats strfmt.Regis if o.ProxysqlExporter != nil { if err := o.ProxysqlExporter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter") } + return err } } @@ -5929,11 +6175,15 @@ func (o *AddServiceOKBodyProxysql) validateService(formats strfmt.Registry) erro if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "service") } + return err } } @@ -5960,7 +6210,6 @@ func (o *AddServiceOKBodyProxysql) ContextValidate(ctx context.Context, formats } func (o *AddServiceOKBodyProxysql) contextValidateProxysqlExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ProxysqlExporter != nil { if swag.IsZero(o.ProxysqlExporter) { // not required @@ -5968,11 +6217,15 @@ func (o *AddServiceOKBodyProxysql) contextValidateProxysqlExporter(ctx context.C } if err := o.ProxysqlExporter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter") } + return err } } @@ -5981,7 +6234,6 @@ func (o *AddServiceOKBodyProxysql) contextValidateProxysqlExporter(ctx context.C } func (o *AddServiceOKBodyProxysql) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -5989,11 +6241,15 @@ func (o *AddServiceOKBodyProxysql) contextValidateService(ctx context.Context, f } if err := o.Service.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "service") } + return err } } @@ -6024,7 +6280,6 @@ AddServiceOKBodyProxysqlProxysqlExporter ProxySQLExporter runs on Generic or Con swagger:model AddServiceOKBodyProxysqlProxysqlExporter */ type AddServiceOKBodyProxysqlProxysqlExporter struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -6055,50 +6310,50 @@ type AddServiceOKBodyProxysqlProxysqlExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` + // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - // Log level for exporters // // - LOG_LEVEL_UNSPECIFIED: Auto // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] LogLevel *string `json:"log_level,omitempty"` + // Optionally expose the exporter process on all public interfaces + ExposeExporter bool `json:"expose_exporter,omitempty"` + // metrics resolutions MetricsResolutions *AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` - - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` } // Validate validates this add service OK body proxysql proxysql exporter func (o *AddServiceOKBodyProxysqlProxysqlExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } @@ -6108,139 +6363,143 @@ func (o *AddServiceOKBodyProxysqlProxysqlExporter) Validate(formats strfmt.Regis return nil } -var addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum []interface{} +var addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum = append(addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum, v) + addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum = append(addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" -// prop value enum -func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" -func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } + // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"proxysql"+"."+"proxysql_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { +// prop value enum +func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum, true); err != nil { return err } - return nil } -func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateMetricsResolutions(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsResolutions) { // not required +func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } - if o.MetricsResolutions != nil { - if err := o.MetricsResolutions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - return err - } + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"proxysql"+"."+"proxysql_exporter"+"."+"status", "body", *o.Status); err != nil { + return err } return nil } -var addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum []interface{} +var addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum = append(addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum, v) + addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum = append(addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"proxysql"+"."+"proxysql_exporter"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"proxysql"+"."+"proxysql_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } return nil } +func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateMetricsResolutions(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsResolutions) { // not required + return nil + } + + if o.MetricsResolutions != nil { + if err := o.MetricsResolutions.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter" + "." + "metrics_resolutions") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter" + "." + "metrics_resolutions") + } + + return err + } + } + + return nil +} + // ContextValidate validate this add service OK body proxysql proxysql exporter based on the context it is used func (o *AddServiceOKBodyProxysqlProxysqlExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -6256,7 +6515,6 @@ func (o *AddServiceOKBodyProxysqlProxysqlExporter) ContextValidate(ctx context.C } func (o *AddServiceOKBodyProxysqlProxysqlExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { - if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -6264,11 +6522,15 @@ func (o *AddServiceOKBodyProxysqlProxysqlExporter) contextValidateMetricsResolut } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter" + "." + "metrics_resolutions") } + return err } } @@ -6299,7 +6561,6 @@ AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions MetricsResolutions re swagger:model AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions */ type AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -6343,7 +6604,6 @@ AddServiceOKBodyProxysqlService ProxySQLService represents a generic ProxySQL in swagger:model AddServiceOKBodyProxysqlService */ type AddServiceOKBodyProxysqlService struct { - // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -6414,7 +6674,6 @@ AddServiceOKBodyRDS add service OK body RDS swagger:model AddServiceOKBodyRDS */ type AddServiceOKBodyRDS struct { - // mysql Mysql *AddServiceOKBodyRDSMysql `json:"mysql,omitempty"` @@ -6489,11 +6748,15 @@ func (o *AddServiceOKBodyRDS) validateMysql(formats strfmt.Registry) error { if o.Mysql != nil { if err := o.Mysql.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysql") } + return err } } @@ -6508,11 +6771,15 @@ func (o *AddServiceOKBodyRDS) validateMysqldExporter(formats strfmt.Registry) er if o.MysqldExporter != nil { if err := o.MysqldExporter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter") } + return err } } @@ -6527,11 +6794,15 @@ func (o *AddServiceOKBodyRDS) validateNode(formats strfmt.Registry) error { if o.Node != nil { if err := o.Node.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "node") } + return err } } @@ -6546,11 +6817,15 @@ func (o *AddServiceOKBodyRDS) validatePostgresql(formats strfmt.Registry) error if o.Postgresql != nil { if err := o.Postgresql.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql") } + return err } } @@ -6565,11 +6840,15 @@ func (o *AddServiceOKBodyRDS) validatePostgresqlExporter(formats strfmt.Registry if o.PostgresqlExporter != nil { if err := o.PostgresqlExporter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter") } + return err } } @@ -6584,11 +6863,15 @@ func (o *AddServiceOKBodyRDS) validateQANMysqlPerfschema(formats strfmt.Registry if o.QANMysqlPerfschema != nil { if err := o.QANMysqlPerfschema.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_mysql_perfschema") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_mysql_perfschema") } + return err } } @@ -6603,11 +6886,15 @@ func (o *AddServiceOKBodyRDS) validateQANPostgresqlPgstatements(formats strfmt.R if o.QANPostgresqlPgstatements != nil { if err := o.QANPostgresqlPgstatements.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_postgresql_pgstatements") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_postgresql_pgstatements") } + return err } } @@ -6622,11 +6909,15 @@ func (o *AddServiceOKBodyRDS) validateRDSExporter(formats strfmt.Registry) error if o.RDSExporter != nil { if err := o.RDSExporter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter") } + return err } } @@ -6677,7 +6968,6 @@ func (o *AddServiceOKBodyRDS) ContextValidate(ctx context.Context, formats strfm } func (o *AddServiceOKBodyRDS) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { - if o.Mysql != nil { if swag.IsZero(o.Mysql) { // not required @@ -6685,11 +6975,15 @@ func (o *AddServiceOKBodyRDS) contextValidateMysql(ctx context.Context, formats } if err := o.Mysql.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysql") } + return err } } @@ -6698,7 +6992,6 @@ func (o *AddServiceOKBodyRDS) contextValidateMysql(ctx context.Context, formats } func (o *AddServiceOKBodyRDS) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MysqldExporter != nil { if swag.IsZero(o.MysqldExporter) { // not required @@ -6706,11 +6999,15 @@ func (o *AddServiceOKBodyRDS) contextValidateMysqldExporter(ctx context.Context, } if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter") } + return err } } @@ -6719,7 +7016,6 @@ func (o *AddServiceOKBodyRDS) contextValidateMysqldExporter(ctx context.Context, } func (o *AddServiceOKBodyRDS) contextValidateNode(ctx context.Context, formats strfmt.Registry) error { - if o.Node != nil { if swag.IsZero(o.Node) { // not required @@ -6727,11 +7023,15 @@ func (o *AddServiceOKBodyRDS) contextValidateNode(ctx context.Context, formats s } if err := o.Node.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "node") } + return err } } @@ -6740,7 +7040,6 @@ func (o *AddServiceOKBodyRDS) contextValidateNode(ctx context.Context, formats s } func (o *AddServiceOKBodyRDS) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { - if o.Postgresql != nil { if swag.IsZero(o.Postgresql) { // not required @@ -6748,11 +7047,15 @@ func (o *AddServiceOKBodyRDS) contextValidatePostgresql(ctx context.Context, for } if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql") } + return err } } @@ -6761,7 +7064,6 @@ func (o *AddServiceOKBodyRDS) contextValidatePostgresql(ctx context.Context, for } func (o *AddServiceOKBodyRDS) contextValidatePostgresqlExporter(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresqlExporter != nil { if swag.IsZero(o.PostgresqlExporter) { // not required @@ -6769,11 +7071,15 @@ func (o *AddServiceOKBodyRDS) contextValidatePostgresqlExporter(ctx context.Cont } if err := o.PostgresqlExporter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter") } + return err } } @@ -6782,7 +7088,6 @@ func (o *AddServiceOKBodyRDS) contextValidatePostgresqlExporter(ctx context.Cont } func (o *AddServiceOKBodyRDS) contextValidateQANMysqlPerfschema(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlPerfschema != nil { if swag.IsZero(o.QANMysqlPerfschema) { // not required @@ -6790,11 +7095,15 @@ func (o *AddServiceOKBodyRDS) contextValidateQANMysqlPerfschema(ctx context.Cont } if err := o.QANMysqlPerfschema.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_mysql_perfschema") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_mysql_perfschema") } + return err } } @@ -6803,7 +7112,6 @@ func (o *AddServiceOKBodyRDS) contextValidateQANMysqlPerfschema(ctx context.Cont } func (o *AddServiceOKBodyRDS) contextValidateQANPostgresqlPgstatements(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatements != nil { if swag.IsZero(o.QANPostgresqlPgstatements) { // not required @@ -6811,11 +7119,15 @@ func (o *AddServiceOKBodyRDS) contextValidateQANPostgresqlPgstatements(ctx conte } if err := o.QANPostgresqlPgstatements.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_postgresql_pgstatements") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_postgresql_pgstatements") } + return err } } @@ -6824,7 +7136,6 @@ func (o *AddServiceOKBodyRDS) contextValidateQANPostgresqlPgstatements(ctx conte } func (o *AddServiceOKBodyRDS) contextValidateRDSExporter(ctx context.Context, formats strfmt.Registry) error { - if o.RDSExporter != nil { if swag.IsZero(o.RDSExporter) { // not required @@ -6832,11 +7143,15 @@ func (o *AddServiceOKBodyRDS) contextValidateRDSExporter(ctx context.Context, fo } if err := o.RDSExporter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter") } + return err } } @@ -6867,7 +7182,6 @@ AddServiceOKBodyRDSMysql MySQLService represents a generic MySQL instance. swagger:model AddServiceOKBodyRDSMysql */ type AddServiceOKBodyRDSMysql struct { - // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -6941,7 +7255,6 @@ AddServiceOKBodyRDSMysqldExporter MySQLdExporter runs on Generic or Container No swagger:model AddServiceOKBodyRDSMysqldExporter */ type AddServiceOKBodyRDSMysqldExporter struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -6989,6 +7302,18 @@ type AddServiceOKBodyRDSMysqldExporter struct { // Actual table count at the moment of adding. TableCount int32 `json:"table_count,omitempty"` + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` + // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` @@ -6998,47 +7323,35 @@ type AddServiceOKBodyRDSMysqldExporter struct { // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` - // Log level for exporters // // - LOG_LEVEL_UNSPECIFIED: Auto // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] LogLevel *string `json:"log_level,omitempty"` + // Optionally expose the exporter process on all public interfaces + ExposeExporter bool `json:"expose_exporter,omitempty"` + + // Extra DSN parameters for MySQL connection. + ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` + // metrics resolutions MetricsResolutions *AddServiceOKBodyRDSMysqldExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` - - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` } // Validate validates this add service OK body RDS mysqld exporter func (o *AddServiceOKBodyRDSMysqldExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } @@ -7048,7 +7361,67 @@ func (o *AddServiceOKBodyRDSMysqldExporter) Validate(formats strfmt.Registry) er return nil } -var addServiceOkBodyRdsMysqldExporterTypeLogLevelPropEnum []interface{} +var addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum = append(addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyRDSMysqldExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyRDSMysqldExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"mysqld_exporter"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + +var addServiceOkBodyRdsMysqldExporterTypeLogLevelPropEnum []any func init() { var res []string @@ -7109,11 +7482,15 @@ func (o *AddServiceOKBodyRDSMysqldExporter) validateMetricsResolutions(formats s if o.MetricsResolutions != nil { if err := o.MetricsResolutions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter" + "." + "metrics_resolutions") } + return err } } @@ -7121,72 +7498,12 @@ func (o *AddServiceOKBodyRDSMysqldExporter) validateMetricsResolutions(formats s return nil } -var addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum []interface{} +// ContextValidate validate this add service OK body RDS mysqld exporter based on the context it is used +func (o *AddServiceOKBodyRDSMysqldExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum = append(addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyRDSMysqldExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyRDSMysqldExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsMysqldExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyRDSMysqldExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"mysqld_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this add service OK body RDS mysqld exporter based on the context it is used -func (o *AddServiceOKBodyRDSMysqldExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) + if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { + res = append(res, err) } if len(res) > 0 { @@ -7196,7 +7513,6 @@ func (o *AddServiceOKBodyRDSMysqldExporter) ContextValidate(ctx context.Context, } func (o *AddServiceOKBodyRDSMysqldExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { - if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -7204,11 +7520,15 @@ func (o *AddServiceOKBodyRDSMysqldExporter) contextValidateMetricsResolutions(ct } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter" + "." + "metrics_resolutions") } + return err } } @@ -7239,7 +7559,6 @@ AddServiceOKBodyRDSMysqldExporterMetricsResolutions MetricsResolutions represent swagger:model AddServiceOKBodyRDSMysqldExporterMetricsResolutions */ type AddServiceOKBodyRDSMysqldExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -7283,7 +7602,6 @@ AddServiceOKBodyRDSNode RemoteRDSNode represents remote RDS Node. Agents can't r swagger:model AddServiceOKBodyRDSNode */ type AddServiceOKBodyRDSNode struct { - // Unique randomly generated instance identifier. NodeID string `json:"node_id,omitempty"` @@ -7342,7 +7660,6 @@ AddServiceOKBodyRDSPostgresql PostgreSQLService represents a generic PostgreSQL swagger:model AddServiceOKBodyRDSPostgresql */ type AddServiceOKBodyRDSPostgresql struct { - // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -7419,7 +7736,6 @@ AddServiceOKBodyRDSPostgresqlExporter PostgresExporter runs on Generic or Contai swagger:model AddServiceOKBodyRDSPostgresqlExporter */ type AddServiceOKBodyRDSPostgresqlExporter struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -7450,12 +7766,30 @@ type AddServiceOKBodyRDSPostgresqlExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` + // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // Limit of databases for auto-discovery. AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` @@ -7465,41 +7799,23 @@ type AddServiceOKBodyRDSPostgresqlExporter struct { // Maximum number of connections that exporter can open to the database instance. MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // metrics resolutions MetricsResolutions *AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` - - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` } // Validate validates this add service OK body RDS postgresql exporter func (o *AddServiceOKBodyRDSPostgresqlExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } @@ -7509,7 +7825,67 @@ func (o *AddServiceOKBodyRDSPostgresqlExporter) Validate(formats strfmt.Registry return nil } -var addServiceOkBodyRdsPostgresqlExporterTypeLogLevelPropEnum []interface{} +var addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum = append(addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum, v) + } +} + +const ( + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyRDSPostgresqlExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceOKBodyRDSPostgresqlExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"postgresql_exporter"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + +var addServiceOkBodyRdsPostgresqlExporterTypeLogLevelPropEnum []any func init() { var res []string @@ -7570,11 +7946,15 @@ func (o *AddServiceOKBodyRDSPostgresqlExporter) validateMetricsResolutions(forma if o.MetricsResolutions != nil { if err := o.MetricsResolutions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter" + "." + "metrics_resolutions") } + return err } } @@ -7582,66 +7962,6 @@ func (o *AddServiceOKBodyRDSPostgresqlExporter) validateMetricsResolutions(forma return nil } -var addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum = append(addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyRDSPostgresqlExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyRDSPostgresqlExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsPostgresqlExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyRDSPostgresqlExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"postgresql_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - // ContextValidate validate this add service OK body RDS postgresql exporter based on the context it is used func (o *AddServiceOKBodyRDSPostgresqlExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -7657,7 +7977,6 @@ func (o *AddServiceOKBodyRDSPostgresqlExporter) ContextValidate(ctx context.Cont } func (o *AddServiceOKBodyRDSPostgresqlExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { - if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -7665,11 +7984,15 @@ func (o *AddServiceOKBodyRDSPostgresqlExporter) contextValidateMetricsResolution } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter" + "." + "metrics_resolutions") } + return err } } @@ -7700,7 +8023,6 @@ AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions MetricsResolutions repre swagger:model AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions */ type AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -7744,7 +8066,6 @@ AddServiceOKBodyRDSQANMysqlPerfschema QANMySQLPerfSchemaAgent runs within pmm-ag swagger:model AddServiceOKBodyRDSQANMysqlPerfschema */ type AddServiceOKBodyRDSQANMysqlPerfschema struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -7787,18 +8108,6 @@ type AddServiceOKBodyRDSQANMysqlPerfschema struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -7810,134 +8119,146 @@ type AddServiceOKBodyRDSQANMysqlPerfschema struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` -} - -// Validate validates this add service OK body RDS QAN mysql perfschema -func (o *AddServiceOKBodyRDSQANMysqlPerfschema) Validate(formats strfmt.Registry) error { - var res []error - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + + // Extra DSN parameters for MySQL connection. + ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` +} + +// Validate validates this add service OK body RDS QAN mysql perfschema +func (o *AddServiceOKBodyRDSQANMysqlPerfschema) Validate(formats strfmt.Registry) error { + var res []error if err := o.validateStatus(formats); err != nil { res = append(res, err) } + if err := o.validateLogLevel(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } -var addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum []interface{} +var addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum = append(addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum, v) + addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum = append(addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" ) // prop value enum -func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum, true); err != nil { +func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required +func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"rds"+"."+"qan_mysql_perfschema"+"."+"log_level", "body", *o.LogLevel); err != nil { + if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"qan_mysql_perfschema"+"."+"status", "body", *o.Status); err != nil { return err } return nil } -var addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum []interface{} +var addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum = append(addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum, v) + addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum = append(addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyRDSQANMysqlPerfschema) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"qan_mysql_perfschema"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"rds"+"."+"qan_mysql_perfschema"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } @@ -7972,7 +8293,6 @@ AddServiceOKBodyRDSQANPostgresqlPgstatements QANPostgreSQLPgStatementsAgent runs swagger:model AddServiceOKBodyRDSQANPostgresqlPgstatements */ type AddServiceOKBodyRDSQANPostgresqlPgstatements struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -8003,15 +8323,6 @@ type AddServiceOKBodyRDSQANPostgresqlPgstatements struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -8023,17 +8334,26 @@ type AddServiceOKBodyRDSQANPostgresqlPgstatements struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` + + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` } // Validate validates this add service OK body RDS QAN postgresql pgstatements func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } @@ -8043,114 +8363,114 @@ func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) Validate(formats strfmt.R return nil } -var addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum []interface{} +var addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum = append(addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum, v) + addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum = append(addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum, v) } } const ( - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" ) // prop value enum -func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum, true); err != nil { +func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required +func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"rds"+"."+"qan_postgresql_pgstatements"+"."+"log_level", "body", *o.LogLevel); err != nil { + if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"qan_postgresql_pgstatements"+"."+"status", "body", *o.Status); err != nil { return err } return nil } -var addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum []interface{} +var addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil { panic(err) } for _, v := range res { - addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum = append(addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum, v) + addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum = append(addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum, v) } } const ( - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" + AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" + AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" + AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" + AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" + AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" + // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" + AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" ) // prop value enum -func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum, true); err != nil { +func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateLogLevelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum, true); err != nil { return err } return nil } -func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required +func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(o.LogLevel) { // not required return nil } // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"qan_postgresql_pgstatements"+"."+"status", "body", *o.Status); err != nil { + if err := o.validateLogLevelEnum("addServiceOk"+"."+"rds"+"."+"qan_postgresql_pgstatements"+"."+"log_level", "body", *o.LogLevel); err != nil { return err } @@ -8185,7 +8505,6 @@ AddServiceOKBodyRDSRDSExporter RDSExporter runs on Generic or Container Node and swagger:model AddServiceOKBodyRDSRDSExporter */ type AddServiceOKBodyRDSRDSExporter struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -8204,6 +8523,18 @@ type AddServiceOKBodyRDSRDSExporter struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` + // AgentStatus represents actual Agent status. + // + // - AGENT_STATUS_STARTING: Agent is starting. + // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. + // - AGENT_STATUS_RUNNING: Agent is running. + // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. + // - AGENT_STATUS_STOPPING: Agent is stopping. + // - AGENT_STATUS_DONE: Agent has been stopped or disabled. + // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` + // Listen port for scraping metrics (the same for several configurations). ListenPort int64 `json:"listen_port,omitempty"` @@ -8219,54 +8550,102 @@ type AddServiceOKBodyRDSRDSExporter struct { // Path to exec process. ProcessExecPath string `json:"process_exec_path,omitempty"` - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` - // Log level for exporters // // - LOG_LEVEL_UNSPECIFIED: Auto // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] LogLevel *string `json:"log_level,omitempty"` + // Limit of databases for auto-discovery. + AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` + // metrics resolutions MetricsResolutions *AddServiceOKBodyRDSRDSExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` +} - // AgentStatus represents actual Agent status. - // - // - AGENT_STATUS_STARTING: Agent is starting. - // - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting. - // - AGENT_STATUS_RUNNING: Agent is running. - // - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon. - // - AGENT_STATUS_STOPPING: Agent is stopping. - // - AGENT_STATUS_DONE: Agent has been stopped or disabled. - // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` +// Validate validates this add service OK body RDS RDS exporter +func (o *AddServiceOKBodyRDSRDSExporter) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := o.validateLogLevel(formats); err != nil { + res = append(res, err) + } + + if err := o.validateMetricsResolutions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var addServiceOkBodyRdsRdsExporterTypeStatusPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceOkBodyRdsRdsExporterTypeStatusPropEnum = append(addServiceOkBodyRdsRdsExporterTypeStatusPropEnum, v) + } } -// Validate validates this add service OK body RDS RDS exporter -func (o *AddServiceOKBodyRDSRDSExporter) Validate(formats strfmt.Registry) error { - var res []error +const ( + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - if err := o.validateMetricsResolutions(formats); err != nil { - res = append(res, err) + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" + + // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" + AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" +) + +// prop value enum +func (o *AddServiceOKBodyRDSRDSExporter) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsRdsExporterTypeStatusPropEnum, true); err != nil { + return err } + return nil +} - if err := o.validateStatus(formats); err != nil { - res = append(res, err) +func (o *AddServiceOKBodyRDSRDSExporter) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil } - if len(res) > 0 { - return errors.CompositeValidationError(res...) + // value enum + if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"rds_exporter"+"."+"status", "body", *o.Status); err != nil { + return err } + return nil } -var addServiceOkBodyRdsRdsExporterTypeLogLevelPropEnum []interface{} +var addServiceOkBodyRdsRdsExporterTypeLogLevelPropEnum []any func init() { var res []string @@ -8327,11 +8706,15 @@ func (o *AddServiceOKBodyRDSRDSExporter) validateMetricsResolutions(formats strf if o.MetricsResolutions != nil { if err := o.MetricsResolutions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter" + "." + "metrics_resolutions") } + return err } } @@ -8339,66 +8722,6 @@ func (o *AddServiceOKBodyRDSRDSExporter) validateMetricsResolutions(formats strf return nil } -var addServiceOkBodyRdsRdsExporterTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceOkBodyRdsRdsExporterTypeStatusPropEnum = append(addServiceOkBodyRdsRdsExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyRDSRDSExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyRDSRDSExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsRdsExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyRDSRDSExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"rds_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - // ContextValidate validate this add service OK body RDS RDS exporter based on the context it is used func (o *AddServiceOKBodyRDSRDSExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -8414,7 +8737,6 @@ func (o *AddServiceOKBodyRDSRDSExporter) ContextValidate(ctx context.Context, fo } func (o *AddServiceOKBodyRDSRDSExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { - if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -8422,11 +8744,15 @@ func (o *AddServiceOKBodyRDSRDSExporter) contextValidateMetricsResolutions(ctx c } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter" + "." + "metrics_resolutions") } + return err } } @@ -8457,7 +8783,6 @@ AddServiceOKBodyRDSRDSExporterMetricsResolutions MetricsResolutions represents P swagger:model AddServiceOKBodyRDSRDSExporterMetricsResolutions */ type AddServiceOKBodyRDSRDSExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -8501,7 +8826,6 @@ AddServiceOKBodyValkey add service OK body valkey swagger:model AddServiceOKBodyValkey */ type AddServiceOKBodyValkey struct { - // service Service *AddServiceOKBodyValkeyService `json:"service,omitempty"` @@ -8534,11 +8858,15 @@ func (o *AddServiceOKBodyValkey) validateService(formats strfmt.Registry) error if o.Service != nil { if err := o.Service.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "service") } + return err } } @@ -8553,11 +8881,15 @@ func (o *AddServiceOKBodyValkey) validateValkeyExporter(formats strfmt.Registry) if o.ValkeyExporter != nil { if err := o.ValkeyExporter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter") } + return err } } @@ -8584,7 +8916,6 @@ func (o *AddServiceOKBodyValkey) ContextValidate(ctx context.Context, formats st } func (o *AddServiceOKBodyValkey) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { if swag.IsZero(o.Service) { // not required @@ -8592,11 +8923,15 @@ func (o *AddServiceOKBodyValkey) contextValidateService(ctx context.Context, for } if err := o.Service.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "service") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "service") } + return err } } @@ -8605,7 +8940,6 @@ func (o *AddServiceOKBodyValkey) contextValidateService(ctx context.Context, for } func (o *AddServiceOKBodyValkey) contextValidateValkeyExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ValkeyExporter != nil { if swag.IsZero(o.ValkeyExporter) { // not required @@ -8613,11 +8947,15 @@ func (o *AddServiceOKBodyValkey) contextValidateValkeyExporter(ctx context.Conte } if err := o.ValkeyExporter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter") } + return err } } @@ -8648,7 +8986,6 @@ AddServiceOKBodyValkeyService ValkeyService represents a generic Valkey instance swagger:model AddServiceOKBodyValkeyService */ type AddServiceOKBodyValkeyService struct { - // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -8719,7 +9056,6 @@ AddServiceOKBodyValkeyValkeyExporter ValkeyExporter runs on Generic or Container swagger:model AddServiceOKBodyValkeyValkeyExporter */ type AddServiceOKBodyValkeyValkeyExporter struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -8750,18 +9086,6 @@ type AddServiceOKBodyValkeyValkeyExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *AddServiceOKBodyValkeyValkeyExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` - // AgentStatus represents actual Agent status. // // - AGENT_STATUS_STARTING: Agent is starting. @@ -8773,17 +9097,29 @@ type AddServiceOKBodyValkeyValkeyExporter struct { // - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: ["AGENT_STATUS_UNSPECIFIED","AGENT_STATUS_STARTING","AGENT_STATUS_INITIALIZATION_ERROR","AGENT_STATUS_RUNNING","AGENT_STATUS_WAITING","AGENT_STATUS_STOPPING","AGENT_STATUS_DONE","AGENT_STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` + + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + + // Path to exec process. + ProcessExecPath string `json:"process_exec_path,omitempty"` + + // Optionally expose the exporter process on all public interfaces + ExposeExporter bool `json:"expose_exporter,omitempty"` + + // metrics resolutions + MetricsResolutions *AddServiceOKBodyValkeyValkeyExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` } // Validate validates this add service OK body valkey valkey exporter func (o *AddServiceOKBodyValkeyValkeyExporter) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsResolutions(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } @@ -8793,26 +9129,7 @@ func (o *AddServiceOKBodyValkeyValkeyExporter) Validate(formats strfmt.Registry) return nil } -func (o *AddServiceOKBodyValkeyValkeyExporter) validateMetricsResolutions(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsResolutions) { // not required - return nil - } - - if o.MetricsResolutions != nil { - if err := o.MetricsResolutions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - return err - } - } - - return nil -} - -var addServiceOkBodyValkeyValkeyExporterTypeStatusPropEnum []interface{} +var addServiceOkBodyValkeyValkeyExporterTypeStatusPropEnum []any func init() { var res []string @@ -8872,6 +9189,29 @@ func (o *AddServiceOKBodyValkeyValkeyExporter) validateStatus(formats strfmt.Reg return nil } +func (o *AddServiceOKBodyValkeyValkeyExporter) validateMetricsResolutions(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsResolutions) { // not required + return nil + } + + if o.MetricsResolutions != nil { + if err := o.MetricsResolutions.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter" + "." + "metrics_resolutions") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter" + "." + "metrics_resolutions") + } + + return err + } + } + + return nil +} + // ContextValidate validate this add service OK body valkey valkey exporter based on the context it is used func (o *AddServiceOKBodyValkeyValkeyExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -8887,7 +9227,6 @@ func (o *AddServiceOKBodyValkeyValkeyExporter) ContextValidate(ctx context.Conte } func (o *AddServiceOKBodyValkeyValkeyExporter) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { - if o.MetricsResolutions != nil { if swag.IsZero(o.MetricsResolutions) { // not required @@ -8895,11 +9234,15 @@ func (o *AddServiceOKBodyValkeyValkeyExporter) contextValidateMetricsResolutions } if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter" + "." + "metrics_resolutions") } + return err } } @@ -8930,7 +9273,6 @@ AddServiceOKBodyValkeyValkeyExporterMetricsResolutions MetricsResolutions repres swagger:model AddServiceOKBodyValkeyValkeyExporterMetricsResolutions */ type AddServiceOKBodyValkeyValkeyExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. Hr string `json:"hr,omitempty"` @@ -8974,7 +9316,6 @@ AddServiceParamsBodyExternal add service params body external swagger:model AddServiceParamsBodyExternal */ type AddServiceParamsBodyExternal struct { - // Node identifier on which an external exporter is been running. // runs_on_node_id should always be passed with node_id. // Exactly one of these parameters should be present: node_id, node_name, add_node. @@ -9025,6 +9366,13 @@ type AddServiceParamsBodyExternal struct { // Group name of external service. Group string `json:"group,omitempty"` + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` + // Skip connection check. SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` @@ -9033,24 +9381,17 @@ type AddServiceParamsBodyExternal struct { // add node AddNode *AddServiceParamsBodyExternalAddNode `json:"add_node,omitempty"` - - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body external func (o *AddServiceParamsBodyExternal) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } @@ -9060,26 +9401,7 @@ func (o *AddServiceParamsBodyExternal) Validate(formats strfmt.Registry) error { return nil } -func (o *AddServiceParamsBodyExternal) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required - return nil - } - - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "external" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "external" + "." + "add_node") - } - return err - } - } - - return nil -} - -var addServiceParamsBodyExternalTypeMetricsModePropEnum []interface{} +var addServiceParamsBodyExternalTypeMetricsModePropEnum []any func init() { var res []string @@ -9124,6 +9446,29 @@ func (o *AddServiceParamsBodyExternal) validateMetricsMode(formats strfmt.Regist return nil } +func (o *AddServiceParamsBodyExternal) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required + return nil + } + + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("body" + "." + "external" + "." + "add_node") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("body" + "." + "external" + "." + "add_node") + } + + return err + } + } + + return nil +} + // ContextValidate validate this add service params body external based on the context it is used func (o *AddServiceParamsBodyExternal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -9139,7 +9484,6 @@ func (o *AddServiceParamsBodyExternal) ContextValidate(ctx context.Context, form } func (o *AddServiceParamsBodyExternal) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -9147,11 +9491,15 @@ func (o *AddServiceParamsBodyExternal) contextValidateAddNode(ctx context.Contex } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "external" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "external" + "." + "add_node") } + return err } } @@ -9182,6 +9530,9 @@ AddServiceParamsBodyExternalAddNode AddNodeParams holds node params and is used swagger:model AddServiceParamsBodyExternalAddNode */ type AddServiceParamsBodyExternalAddNode struct { + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -9209,10 +9560,6 @@ type AddServiceParamsBodyExternalAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body external add node @@ -9229,7 +9576,7 @@ func (o *AddServiceParamsBodyExternalAddNode) Validate(formats strfmt.Registry) return nil } -var addServiceParamsBodyExternalAddNodeTypeNodeTypePropEnum []interface{} +var addServiceParamsBodyExternalAddNodeTypeNodeTypePropEnum []any func init() { var res []string @@ -9311,7 +9658,6 @@ AddServiceParamsBodyHaproxy add service params body haproxy swagger:model AddServiceParamsBodyHaproxy */ type AddServiceParamsBodyHaproxy struct { - // Node identifier on which an external exporter is been running. // Exactly one of these parameters should be present: node_id, node_name, add_node. NodeID string `json:"node_id,omitempty"` @@ -9354,6 +9700,13 @@ type AddServiceParamsBodyHaproxy struct { // Custom user-assigned labels for Service. CustomLabels map[string]string `json:"custom_labels,omitempty"` + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` + // Skip connection check. SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` @@ -9362,24 +9715,17 @@ type AddServiceParamsBodyHaproxy struct { // add node AddNode *AddServiceParamsBodyHaproxyAddNode `json:"add_node,omitempty"` - - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body haproxy func (o *AddServiceParamsBodyHaproxy) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } @@ -9389,26 +9735,7 @@ func (o *AddServiceParamsBodyHaproxy) Validate(formats strfmt.Registry) error { return nil } -func (o *AddServiceParamsBodyHaproxy) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required - return nil - } - - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "haproxy" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "haproxy" + "." + "add_node") - } - return err - } - } - - return nil -} - -var addServiceParamsBodyHaproxyTypeMetricsModePropEnum []interface{} +var addServiceParamsBodyHaproxyTypeMetricsModePropEnum []any func init() { var res []string @@ -9453,6 +9780,29 @@ func (o *AddServiceParamsBodyHaproxy) validateMetricsMode(formats strfmt.Registr return nil } +func (o *AddServiceParamsBodyHaproxy) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required + return nil + } + + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("body" + "." + "haproxy" + "." + "add_node") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("body" + "." + "haproxy" + "." + "add_node") + } + + return err + } + } + + return nil +} + // ContextValidate validate this add service params body haproxy based on the context it is used func (o *AddServiceParamsBodyHaproxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -9468,7 +9818,6 @@ func (o *AddServiceParamsBodyHaproxy) ContextValidate(ctx context.Context, forma } func (o *AddServiceParamsBodyHaproxy) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -9476,11 +9825,15 @@ func (o *AddServiceParamsBodyHaproxy) contextValidateAddNode(ctx context.Context } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "haproxy" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "haproxy" + "." + "add_node") } + return err } } @@ -9511,6 +9864,9 @@ AddServiceParamsBodyHaproxyAddNode AddNodeParams holds node params and is used t swagger:model AddServiceParamsBodyHaproxyAddNode */ type AddServiceParamsBodyHaproxyAddNode struct { + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -9538,10 +9894,6 @@ type AddServiceParamsBodyHaproxyAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body haproxy add node @@ -9558,7 +9910,7 @@ func (o *AddServiceParamsBodyHaproxyAddNode) Validate(formats strfmt.Registry) e return nil } -var addServiceParamsBodyHaproxyAddNodeTypeNodeTypePropEnum []interface{} +var addServiceParamsBodyHaproxyAddNodeTypeNodeTypePropEnum []any func init() { var res []string @@ -9640,7 +9992,6 @@ AddServiceParamsBodyMongodb add service params body mongodb swagger:model AddServiceParamsBodyMongodb */ type AddServiceParamsBodyMongodb struct { - // Node identifier on which a service is been running. // Exactly one of these parameters should be present: node_id, node_name, add_node. NodeID string `json:"node_id,omitempty"` @@ -9712,6 +10063,13 @@ type AddServiceParamsBodyMongodb struct { // Limit query length in QAN (default: server-defined; -1: no limit). MaxQueryLength int32 `json:"max_query_length,omitempty"` + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` + // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` @@ -9736,6 +10094,12 @@ type AddServiceParamsBodyMongodb struct { // Enable all collectors EnableAllCollectors bool `json:"enable_all_collectors,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // Optionally expose the exporter process on all public interfaces ExposeExporter bool `json:"expose_exporter,omitempty"` @@ -9748,26 +10112,13 @@ type AddServiceParamsBodyMongodb struct { // add node AddNode *AddServiceParamsBodyMongodbAddNode `json:"add_node,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body mongodb func (o *AddServiceParamsBodyMongodb) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -9775,7 +10126,7 @@ func (o *AddServiceParamsBodyMongodb) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } @@ -9785,26 +10136,52 @@ func (o *AddServiceParamsBodyMongodb) Validate(formats strfmt.Registry) error { return nil } -func (o *AddServiceParamsBodyMongodb) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required +var addServiceParamsBodyMongodbTypeMetricsModePropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceParamsBodyMongodbTypeMetricsModePropEnum = append(addServiceParamsBodyMongodbTypeMetricsModePropEnum, v) + } +} + +const ( + + // AddServiceParamsBodyMongodbMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" + AddServiceParamsBodyMongodbMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" + + // AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" + AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" + + // AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" + AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" +) + +// prop value enum +func (o *AddServiceParamsBodyMongodb) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceParamsBodyMongodbTypeMetricsModePropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceParamsBodyMongodb) validateMetricsMode(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsMode) { // not required return nil } - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "mongodb" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "mongodb" + "." + "add_node") - } - return err - } + // value enum + if err := o.validateMetricsModeEnum("body"+"."+"mongodb"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + return err } return nil } -var addServiceParamsBodyMongodbTypeLogLevelPropEnum []interface{} +var addServiceParamsBodyMongodbTypeLogLevelPropEnum []any func init() { var res []string @@ -9858,46 +10235,24 @@ func (o *AddServiceParamsBodyMongodb) validateLogLevel(formats strfmt.Registry) return nil } -var addServiceParamsBodyMongodbTypeMetricsModePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceParamsBodyMongodbTypeMetricsModePropEnum = append(addServiceParamsBodyMongodbTypeMetricsModePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyMongodbMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - AddServiceParamsBodyMongodbMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - - // AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - - // AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - AddServiceParamsBodyMongodbMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) - -// prop value enum -func (o *AddServiceParamsBodyMongodb) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyMongodbTypeMetricsModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyMongodb) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required +func (o *AddServiceParamsBodyMongodb) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required return nil } - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"mongodb"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("body" + "." + "mongodb" + "." + "add_node") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("body" + "." + "mongodb" + "." + "add_node") + } + + return err + } } return nil @@ -9918,7 +10273,6 @@ func (o *AddServiceParamsBodyMongodb) ContextValidate(ctx context.Context, forma } func (o *AddServiceParamsBodyMongodb) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -9926,11 +10280,15 @@ func (o *AddServiceParamsBodyMongodb) contextValidateAddNode(ctx context.Context } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "mongodb" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "mongodb" + "." + "add_node") } + return err } } @@ -9961,6 +10319,9 @@ AddServiceParamsBodyMongodbAddNode AddNodeParams holds node params and is used t swagger:model AddServiceParamsBodyMongodbAddNode */ type AddServiceParamsBodyMongodbAddNode struct { + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -9988,10 +10349,6 @@ type AddServiceParamsBodyMongodbAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body mongodb add node @@ -10008,7 +10365,7 @@ func (o *AddServiceParamsBodyMongodbAddNode) Validate(formats strfmt.Registry) e return nil } -var addServiceParamsBodyMongodbAddNodeTypeNodeTypePropEnum []interface{} +var addServiceParamsBodyMongodbAddNodeTypeNodeTypePropEnum []any func init() { var res []string @@ -10090,7 +10447,6 @@ AddServiceParamsBodyMysql add service params body mysql swagger:model AddServiceParamsBodyMysql */ type AddServiceParamsBodyMysql struct { - // Node identifier on which a service is been running. // Exactly one of these parameters should be present: node_id, node_name, add_node. NodeID string `json:"node_id,omitempty"` @@ -10178,12 +10534,25 @@ type AddServiceParamsBodyMysql struct { // Use negative value to disable them. TablestatsGroupTableLimit int32 `json:"tablestats_group_table_limit,omitempty"` + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` + // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` // Custom password for exporter endpoint /metrics. AgentPassword string `json:"agent_password,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // Optionally expose the exporter process on all public interfaces ExposeExporter bool `json:"expose_exporter,omitempty"` @@ -10192,26 +10561,13 @@ type AddServiceParamsBodyMysql struct { // add node AddNode *AddServiceParamsBodyMysqlAddNode `json:"add_node,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body mysql func (o *AddServiceParamsBodyMysql) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -10219,7 +10575,7 @@ func (o *AddServiceParamsBodyMysql) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } @@ -10229,26 +10585,52 @@ func (o *AddServiceParamsBodyMysql) Validate(formats strfmt.Registry) error { return nil } -func (o *AddServiceParamsBodyMysql) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required +var addServiceParamsBodyMysqlTypeMetricsModePropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceParamsBodyMysqlTypeMetricsModePropEnum = append(addServiceParamsBodyMysqlTypeMetricsModePropEnum, v) + } +} + +const ( + + // AddServiceParamsBodyMysqlMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" + AddServiceParamsBodyMysqlMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" + + // AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" + AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" + + // AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" + AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" +) + +// prop value enum +func (o *AddServiceParamsBodyMysql) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceParamsBodyMysqlTypeMetricsModePropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceParamsBodyMysql) validateMetricsMode(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsMode) { // not required return nil } - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "mysql" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "mysql" + "." + "add_node") - } - return err - } + // value enum + if err := o.validateMetricsModeEnum("body"+"."+"mysql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + return err } return nil } -var addServiceParamsBodyMysqlTypeLogLevelPropEnum []interface{} +var addServiceParamsBodyMysqlTypeLogLevelPropEnum []any func init() { var res []string @@ -10302,46 +10684,24 @@ func (o *AddServiceParamsBodyMysql) validateLogLevel(formats strfmt.Registry) er return nil } -var addServiceParamsBodyMysqlTypeMetricsModePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceParamsBodyMysqlTypeMetricsModePropEnum = append(addServiceParamsBodyMysqlTypeMetricsModePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyMysqlMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - AddServiceParamsBodyMysqlMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - - // AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - - // AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - AddServiceParamsBodyMysqlMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) - -// prop value enum -func (o *AddServiceParamsBodyMysql) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyMysqlTypeMetricsModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyMysql) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required +func (o *AddServiceParamsBodyMysql) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required return nil } - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"mysql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("body" + "." + "mysql" + "." + "add_node") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("body" + "." + "mysql" + "." + "add_node") + } + + return err + } } return nil @@ -10362,7 +10722,6 @@ func (o *AddServiceParamsBodyMysql) ContextValidate(ctx context.Context, formats } func (o *AddServiceParamsBodyMysql) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -10370,11 +10729,15 @@ func (o *AddServiceParamsBodyMysql) contextValidateAddNode(ctx context.Context, } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "mysql" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "mysql" + "." + "add_node") } + return err } } @@ -10405,6 +10768,9 @@ AddServiceParamsBodyMysqlAddNode AddNodeParams holds node params and is used to swagger:model AddServiceParamsBodyMysqlAddNode */ type AddServiceParamsBodyMysqlAddNode struct { + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -10432,10 +10798,6 @@ type AddServiceParamsBodyMysqlAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body mysql add node @@ -10452,7 +10814,7 @@ func (o *AddServiceParamsBodyMysqlAddNode) Validate(formats strfmt.Registry) err return nil } -var addServiceParamsBodyMysqlAddNodeTypeNodeTypePropEnum []interface{} +var addServiceParamsBodyMysqlAddNodeTypeNodeTypePropEnum []any func init() { var res []string @@ -10534,7 +10896,6 @@ AddServiceParamsBodyPostgresql add service params body postgresql swagger:model AddServiceParamsBodyPostgresql */ type AddServiceParamsBodyPostgresql struct { - // Node identifier on which a service is been running. // Exactly one of these parameters should be present: node_id, node_name, add_node. NodeID string `json:"node_id,omitempty"` @@ -10606,6 +10967,13 @@ type AddServiceParamsBodyPostgresql struct { // Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full. TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` + // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` @@ -10621,6 +10989,12 @@ type AddServiceParamsBodyPostgresql struct { // Custom password for exporter endpoint /metrics. AgentPassword string `json:"agent_password,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // Limit for auto discovery. AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` @@ -10632,26 +11006,13 @@ type AddServiceParamsBodyPostgresql struct { // add node AddNode *AddServiceParamsBodyPostgresqlAddNode `json:"add_node,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body postgresql func (o *AddServiceParamsBodyPostgresql) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -10659,7 +11020,7 @@ func (o *AddServiceParamsBodyPostgresql) Validate(formats strfmt.Registry) error res = append(res, err) } - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } @@ -10669,26 +11030,52 @@ func (o *AddServiceParamsBodyPostgresql) Validate(formats strfmt.Registry) error return nil } -func (o *AddServiceParamsBodyPostgresql) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required +var addServiceParamsBodyPostgresqlTypeMetricsModePropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceParamsBodyPostgresqlTypeMetricsModePropEnum = append(addServiceParamsBodyPostgresqlTypeMetricsModePropEnum, v) + } +} + +const ( + + // AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" + AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" + + // AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" + AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" + + // AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" + AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" +) + +// prop value enum +func (o *AddServiceParamsBodyPostgresql) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceParamsBodyPostgresqlTypeMetricsModePropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceParamsBodyPostgresql) validateMetricsMode(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsMode) { // not required return nil } - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "postgresql" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "postgresql" + "." + "add_node") - } - return err - } + // value enum + if err := o.validateMetricsModeEnum("body"+"."+"postgresql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + return err } return nil } -var addServiceParamsBodyPostgresqlTypeLogLevelPropEnum []interface{} +var addServiceParamsBodyPostgresqlTypeLogLevelPropEnum []any func init() { var res []string @@ -10742,46 +11129,24 @@ func (o *AddServiceParamsBodyPostgresql) validateLogLevel(formats strfmt.Registr return nil } -var addServiceParamsBodyPostgresqlTypeMetricsModePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceParamsBodyPostgresqlTypeMetricsModePropEnum = append(addServiceParamsBodyPostgresqlTypeMetricsModePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - - // AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - - // AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - AddServiceParamsBodyPostgresqlMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) - -// prop value enum -func (o *AddServiceParamsBodyPostgresql) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyPostgresqlTypeMetricsModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyPostgresql) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required +func (o *AddServiceParamsBodyPostgresql) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required return nil } - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"postgresql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("body" + "." + "postgresql" + "." + "add_node") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("body" + "." + "postgresql" + "." + "add_node") + } + + return err + } } return nil @@ -10802,7 +11167,6 @@ func (o *AddServiceParamsBodyPostgresql) ContextValidate(ctx context.Context, fo } func (o *AddServiceParamsBodyPostgresql) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -10810,11 +11174,15 @@ func (o *AddServiceParamsBodyPostgresql) contextValidateAddNode(ctx context.Cont } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "postgresql" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "postgresql" + "." + "add_node") } + return err } } @@ -10845,6 +11213,9 @@ AddServiceParamsBodyPostgresqlAddNode AddNodeParams holds node params and is use swagger:model AddServiceParamsBodyPostgresqlAddNode */ type AddServiceParamsBodyPostgresqlAddNode struct { + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -10872,10 +11243,6 @@ type AddServiceParamsBodyPostgresqlAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body postgresql add node @@ -10892,7 +11259,7 @@ func (o *AddServiceParamsBodyPostgresqlAddNode) Validate(formats strfmt.Registry return nil } -var addServiceParamsBodyPostgresqlAddNodeTypeNodeTypePropEnum []interface{} +var addServiceParamsBodyPostgresqlAddNodeTypeNodeTypePropEnum []any func init() { var res []string @@ -10974,7 +11341,6 @@ AddServiceParamsBodyProxysql add service params body proxysql swagger:model AddServiceParamsBodyProxysql */ type AddServiceParamsBodyProxysql struct { - // Node identifier on which a service is been running. // Exactly one of these parameters should be present: node_id, node_name, add_node. NodeID string `json:"node_id,omitempty"` @@ -11028,74 +11394,100 @@ type AddServiceParamsBodyProxysql struct { // Skip TLS certificate and hostname validation. TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` + // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` // Custom password for exporter endpoint /metrics. AgentPassword string `json:"agent_password,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // Optionally expose the exporter process on all public interfaces ExposeExporter bool `json:"expose_exporter,omitempty"` // add node AddNode *AddServiceParamsBodyProxysqlAddNode `json:"add_node,omitempty"` +} - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` +// Validate validates this add service params body proxysql +func (o *AddServiceParamsBodyProxysql) Validate(formats strfmt.Registry) error { + var res []error - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` + if err := o.validateMetricsMode(formats); err != nil { + res = append(res, err) + } + + if err := o.validateLogLevel(formats); err != nil { + res = append(res, err) + } + + if err := o.validateAddNode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var addServiceParamsBodyProxysqlTypeMetricsModePropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceParamsBodyProxysqlTypeMetricsModePropEnum = append(addServiceParamsBodyProxysqlTypeMetricsModePropEnum, v) + } } -// Validate validates this add service params body proxysql -func (o *AddServiceParamsBodyProxysql) Validate(formats strfmt.Registry) error { - var res []error +const ( - if err := o.validateAddNode(formats); err != nil { - res = append(res, err) - } + // AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" + AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } + // AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" + AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - if err := o.validateMetricsMode(formats); err != nil { - res = append(res, err) - } + // AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" + AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" +) - if len(res) > 0 { - return errors.CompositeValidationError(res...) +// prop value enum +func (o *AddServiceParamsBodyProxysql) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceParamsBodyProxysqlTypeMetricsModePropEnum, true); err != nil { + return err } return nil } -func (o *AddServiceParamsBodyProxysql) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required +func (o *AddServiceParamsBodyProxysql) validateMetricsMode(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsMode) { // not required return nil } - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "proxysql" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "proxysql" + "." + "add_node") - } - return err - } + // value enum + if err := o.validateMetricsModeEnum("body"+"."+"proxysql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + return err } return nil } -var addServiceParamsBodyProxysqlTypeLogLevelPropEnum []interface{} +var addServiceParamsBodyProxysqlTypeLogLevelPropEnum []any func init() { var res []string @@ -11149,46 +11541,24 @@ func (o *AddServiceParamsBodyProxysql) validateLogLevel(formats strfmt.Registry) return nil } -var addServiceParamsBodyProxysqlTypeMetricsModePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceParamsBodyProxysqlTypeMetricsModePropEnum = append(addServiceParamsBodyProxysqlTypeMetricsModePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - - // AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - - // AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - AddServiceParamsBodyProxysqlMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) - -// prop value enum -func (o *AddServiceParamsBodyProxysql) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyProxysqlTypeMetricsModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyProxysql) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required +func (o *AddServiceParamsBodyProxysql) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required return nil } - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"proxysql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("body" + "." + "proxysql" + "." + "add_node") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("body" + "." + "proxysql" + "." + "add_node") + } + + return err + } } return nil @@ -11209,7 +11579,6 @@ func (o *AddServiceParamsBodyProxysql) ContextValidate(ctx context.Context, form } func (o *AddServiceParamsBodyProxysql) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -11217,11 +11586,15 @@ func (o *AddServiceParamsBodyProxysql) contextValidateAddNode(ctx context.Contex } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "proxysql" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "proxysql" + "." + "add_node") } + return err } } @@ -11252,6 +11625,9 @@ AddServiceParamsBodyProxysqlAddNode AddNodeParams holds node params and is used swagger:model AddServiceParamsBodyProxysqlAddNode */ type AddServiceParamsBodyProxysqlAddNode struct { + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -11279,10 +11655,6 @@ type AddServiceParamsBodyProxysqlAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body proxysql add node @@ -11299,7 +11671,7 @@ func (o *AddServiceParamsBodyProxysqlAddNode) Validate(formats strfmt.Registry) return nil } -var addServiceParamsBodyProxysqlAddNodeTypeNodeTypePropEnum []interface{} +var addServiceParamsBodyProxysqlAddNodeTypeNodeTypePropEnum []any func init() { var res []string @@ -11381,7 +11753,6 @@ AddServiceParamsBodyRDS add service params body RDS swagger:model AddServiceParamsBodyRDS */ type AddServiceParamsBodyRDS struct { - // AWS region. Region string `json:"region,omitempty"` @@ -11400,6 +11771,10 @@ type AddServiceParamsBodyRDS struct { // Access port. Port int64 `json:"port,omitempty"` + // DiscoverRDSEngine describes supported RDS instance engines. + // Enum: ["DISCOVER_RDS_ENGINE_UNSPECIFIED","DISCOVER_RDS_ENGINE_MYSQL","DISCOVER_RDS_ENGINE_POSTGRESQL"] + Engine *string `json:"engine,omitempty"` + // PMM Agent ID. PMMAgentID string `json:"pmm_agent_id,omitempty"` @@ -11462,6 +11837,13 @@ type AddServiceParamsBodyRDS struct { // Disable enhanced metrics. DisableEnhancedMetrics bool `json:"disable_enhanced_metrics,omitempty"` + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` + // If true, add qan-pgstatements QANPostgresqlPgstatements bool `json:"qan_postgresql_pgstatements,omitempty"` @@ -11479,17 +11861,6 @@ type AddServiceParamsBodyRDS struct { // Maximum number of exporter connections to PostgreSQL instance. MaxPostgresqlExporterConnections int32 `json:"max_postgresql_exporter_connections,omitempty"` - - // DiscoverRDSEngine describes supported RDS instance engines. - // Enum: ["DISCOVER_RDS_ENGINE_UNSPECIFIED","DISCOVER_RDS_ENGINE_MYSQL","DISCOVER_RDS_ENGINE_POSTGRESQL"] - Engine *string `json:"engine,omitempty"` - - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body RDS @@ -11510,7 +11881,7 @@ func (o *AddServiceParamsBodyRDS) Validate(formats strfmt.Registry) error { return nil } -var addServiceParamsBodyRdsTypeEnginePropEnum []interface{} +var addServiceParamsBodyRdsTypeEnginePropEnum []any func init() { var res []string @@ -11555,7 +11926,7 @@ func (o *AddServiceParamsBodyRDS) validateEngine(formats strfmt.Registry) error return nil } -var addServiceParamsBodyRdsTypeMetricsModePropEnum []interface{} +var addServiceParamsBodyRdsTypeMetricsModePropEnum []any func init() { var res []string @@ -11628,7 +11999,6 @@ AddServiceParamsBodyValkey add service params body valkey swagger:model AddServiceParamsBodyValkey */ type AddServiceParamsBodyValkey struct { - // Node identifier on which the service is running. // Only one of these parameters should be present: node_id, node_name, add_node. NodeID string `json:"node_id,omitempty"` @@ -11682,6 +12052,19 @@ type AddServiceParamsBodyValkey struct { // Skip TLS verification. TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` + + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // Optionally expose the exporter process on all public interfaces ExposeExporter bool `json:"expose_exporter,omitempty"` @@ -11699,26 +12082,13 @@ type AddServiceParamsBodyValkey struct { // add node AddNode *AddServiceParamsBodyValkeyAddNode `json:"add_node,omitempty"` - - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add service params body valkey func (o *AddServiceParamsBodyValkey) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -11726,7 +12096,7 @@ func (o *AddServiceParamsBodyValkey) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } @@ -11736,26 +12106,52 @@ func (o *AddServiceParamsBodyValkey) Validate(formats strfmt.Registry) error { return nil } -func (o *AddServiceParamsBodyValkey) validateAddNode(formats strfmt.Registry) error { - if swag.IsZero(o.AddNode) { // not required +var addServiceParamsBodyValkeyTypeMetricsModePropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addServiceParamsBodyValkeyTypeMetricsModePropEnum = append(addServiceParamsBodyValkeyTypeMetricsModePropEnum, v) + } +} + +const ( + + // AddServiceParamsBodyValkeyMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" + AddServiceParamsBodyValkeyMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" + + // AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" + AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" + + // AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" + AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" +) + +// prop value enum +func (o *AddServiceParamsBodyValkey) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addServiceParamsBodyValkeyTypeMetricsModePropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddServiceParamsBodyValkey) validateMetricsMode(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsMode) { // not required return nil } - if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "valkey" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "valkey" + "." + "add_node") - } - return err - } + // value enum + if err := o.validateMetricsModeEnum("body"+"."+"valkey"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + return err } return nil } -var addServiceParamsBodyValkeyTypeLogLevelPropEnum []interface{} +var addServiceParamsBodyValkeyTypeLogLevelPropEnum []any func init() { var res []string @@ -11809,46 +12205,24 @@ func (o *AddServiceParamsBodyValkey) validateLogLevel(formats strfmt.Registry) e return nil } -var addServiceParamsBodyValkeyTypeMetricsModePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceParamsBodyValkeyTypeMetricsModePropEnum = append(addServiceParamsBodyValkeyTypeMetricsModePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyValkeyMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - AddServiceParamsBodyValkeyMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - - // AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - - // AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - AddServiceParamsBodyValkeyMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) - -// prop value enum -func (o *AddServiceParamsBodyValkey) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyValkeyTypeMetricsModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyValkey) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required +func (o *AddServiceParamsBodyValkey) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required return nil } - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"valkey"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("body" + "." + "valkey" + "." + "add_node") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("body" + "." + "valkey" + "." + "add_node") + } + + return err + } } return nil @@ -11869,7 +12243,6 @@ func (o *AddServiceParamsBodyValkey) ContextValidate(ctx context.Context, format } func (o *AddServiceParamsBodyValkey) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { if swag.IsZero(o.AddNode) { // not required @@ -11877,11 +12250,15 @@ func (o *AddServiceParamsBodyValkey) contextValidateAddNode(ctx context.Context, } if err := o.AddNode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("body" + "." + "valkey" + "." + "add_node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("body" + "." + "valkey" + "." + "add_node") } + return err } } @@ -11912,6 +12289,9 @@ AddServiceParamsBodyValkeyAddNode AddNodeParams holds node params and is used to swagger:model AddServiceParamsBodyValkeyAddNode */ type AddServiceParamsBodyValkeyAddNode struct { + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -11939,10 +12319,6 @@ type AddServiceParamsBodyValkeyAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` } // Validate validates this add service params body valkey add node @@ -11959,7 +12335,7 @@ func (o *AddServiceParamsBodyValkeyAddNode) Validate(formats strfmt.Registry) er return nil } -var addServiceParamsBodyValkeyAddNodeTypeNodeTypePropEnum []interface{} +var addServiceParamsBodyValkeyAddNodeTypeNodeTypePropEnum []any func init() { var res []string diff --git a/api/management/v1/json/client/management_service/create_node_install_token_parameters.go b/api/management/v1/json/client/management_service/create_node_install_token_parameters.go index e9581d24fde..6f84f24da00 100644 --- a/api/management/v1/json/client/management_service/create_node_install_token_parameters.go +++ b/api/management/v1/json/client/management_service/create_node_install_token_parameters.go @@ -60,7 +60,6 @@ CreateNodeInstallTokenParams contains all the parameters to send to the API endp Typically these are written to a http.Request. */ type CreateNodeInstallTokenParams struct { - /* Body. CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash). @@ -133,7 +132,6 @@ func (o *CreateNodeInstallTokenParams) SetBody(body CreateNodeInstallTokenBody) // WriteToRequest writes these params to a swagger request func (o *CreateNodeInstallTokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/create_node_install_token_responses.go b/api/management/v1/json/client/management_service/create_node_install_token_responses.go index a20e2b7e4c3..4693dfb3483 100644 --- a/api/management/v1/json/client/management_service/create_node_install_token_responses.go +++ b/api/management/v1/json/client/management_service/create_node_install_token_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +26,7 @@ type CreateNodeInstallTokenReader struct { } // ReadResponse reads a server response into the received o. -func (o *CreateNodeInstallTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *CreateNodeInstallTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewCreateNodeInstallTokenOK() @@ -104,11 +105,10 @@ func (o *CreateNodeInstallTokenOK) GetPayload() *CreateNodeInstallTokenOKBody { } func (o *CreateNodeInstallTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CreateNodeInstallTokenOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -178,11 +178,10 @@ func (o *CreateNodeInstallTokenDefault) GetPayload() *CreateNodeInstallTokenDefa } func (o *CreateNodeInstallTokenDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CreateNodeInstallTokenDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -194,7 +193,6 @@ CreateNodeInstallTokenBody CreateNodeInstallTokenRequest requests a short-lived swagger:model CreateNodeInstallTokenBody */ type CreateNodeInstallTokenBody struct { - // Token TTL in seconds; 0 means use server default. Server clamps to a maximum. TTLSeconds int64 `json:"ttl_seconds,omitempty"` @@ -235,7 +233,6 @@ CreateNodeInstallTokenDefaultBody create node install token default body swagger:model CreateNodeInstallTokenDefaultBody */ type CreateNodeInstallTokenDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -272,11 +269,15 @@ func (o *CreateNodeInstallTokenDefaultBody) validateDetails(formats strfmt.Regis if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("CreateNodeInstallToken default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("CreateNodeInstallToken default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -301,9 +302,7 @@ func (o *CreateNodeInstallTokenDefaultBody) ContextValidate(ctx context.Context, } func (o *CreateNodeInstallTokenDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -311,15 +310,18 @@ func (o *CreateNodeInstallTokenDefaultBody) contextValidateDetails(ctx context.C } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("CreateNodeInstallToken default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("CreateNodeInstallToken default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -348,19 +350,17 @@ CreateNodeInstallTokenDefaultBodyDetailsItems0 create node install token default swagger:model CreateNodeInstallTokenDefaultBodyDetailsItems0 */ type CreateNodeInstallTokenDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // create node install token default body details items0 - CreateNodeInstallTokenDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + CreateNodeInstallTokenDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *CreateNodeInstallTokenDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -381,9 +381,9 @@ func (o *CreateNodeInstallTokenDefaultBodyDetailsItems0) UnmarshalJSON(data []by delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -398,7 +398,6 @@ func (o *CreateNodeInstallTokenDefaultBodyDetailsItems0) UnmarshalJSON(data []by // MarshalJSON marshals this object with additional properties into a JSON object func (o CreateNodeInstallTokenDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -462,7 +461,6 @@ CreateNodeInstallTokenOKBody CreateNodeInstallTokenResponse returns a one-time t swagger:model CreateNodeInstallTokenOKBody */ type CreateNodeInstallTokenOKBody struct { - // Plaintext token for PMM_SERVER_URL userinfo (service_token:). Token string `json:"token,omitempty"` diff --git a/api/management/v1/json/client/management_service/discover_azure_database_parameters.go b/api/management/v1/json/client/management_service/discover_azure_database_parameters.go index 75b1e24acba..f5f9f75a926 100644 --- a/api/management/v1/json/client/management_service/discover_azure_database_parameters.go +++ b/api/management/v1/json/client/management_service/discover_azure_database_parameters.go @@ -60,7 +60,6 @@ DiscoverAzureDatabaseParams contains all the parameters to send to the API endpo Typically these are written to a http.Request. */ type DiscoverAzureDatabaseParams struct { - /* Body. DiscoverAzureDatabaseRequest discover azure databases request. @@ -133,7 +132,6 @@ func (o *DiscoverAzureDatabaseParams) SetBody(body DiscoverAzureDatabaseBody) { // WriteToRequest writes these params to a swagger request func (o *DiscoverAzureDatabaseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/discover_azure_database_responses.go b/api/management/v1/json/client/management_service/discover_azure_database_responses.go index b8bf675e43f..ee99deb5004 100644 --- a/api/management/v1/json/client/management_service/discover_azure_database_responses.go +++ b/api/management/v1/json/client/management_service/discover_azure_database_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +26,7 @@ type DiscoverAzureDatabaseReader struct { } // ReadResponse reads a server response into the received o. -func (o *DiscoverAzureDatabaseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *DiscoverAzureDatabaseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewDiscoverAzureDatabaseOK() @@ -104,11 +105,10 @@ func (o *DiscoverAzureDatabaseOK) GetPayload() *DiscoverAzureDatabaseOKBody { } func (o *DiscoverAzureDatabaseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(DiscoverAzureDatabaseOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -178,11 +178,10 @@ func (o *DiscoverAzureDatabaseDefault) GetPayload() *DiscoverAzureDatabaseDefaul } func (o *DiscoverAzureDatabaseDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(DiscoverAzureDatabaseDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -194,7 +193,6 @@ DiscoverAzureDatabaseBody DiscoverAzureDatabaseRequest discover azure databases swagger:model DiscoverAzureDatabaseBody */ type DiscoverAzureDatabaseBody struct { - // Azure client ID. AzureClientID string `json:"azure_client_id,omitempty"` @@ -241,7 +239,6 @@ DiscoverAzureDatabaseDefaultBody discover azure database default body swagger:model DiscoverAzureDatabaseDefaultBody */ type DiscoverAzureDatabaseDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -278,11 +275,15 @@ func (o *DiscoverAzureDatabaseDefaultBody) validateDetails(formats strfmt.Regist if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -307,9 +308,7 @@ func (o *DiscoverAzureDatabaseDefaultBody) ContextValidate(ctx context.Context, } func (o *DiscoverAzureDatabaseDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -317,15 +316,18 @@ func (o *DiscoverAzureDatabaseDefaultBody) contextValidateDetails(ctx context.Co } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -354,19 +356,17 @@ DiscoverAzureDatabaseDefaultBodyDetailsItems0 discover azure database default bo swagger:model DiscoverAzureDatabaseDefaultBodyDetailsItems0 */ type DiscoverAzureDatabaseDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // discover azure database default body details items0 - DiscoverAzureDatabaseDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + DiscoverAzureDatabaseDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *DiscoverAzureDatabaseDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -387,9 +387,9 @@ func (o *DiscoverAzureDatabaseDefaultBodyDetailsItems0) UnmarshalJSON(data []byt delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -404,7 +404,6 @@ func (o *DiscoverAzureDatabaseDefaultBodyDetailsItems0) UnmarshalJSON(data []byt // MarshalJSON marshals this object with additional properties into a JSON object func (o DiscoverAzureDatabaseDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -468,7 +467,6 @@ DiscoverAzureDatabaseOKBody DiscoverAzureDatabaseResponse discover azure databas swagger:model DiscoverAzureDatabaseOKBody */ type DiscoverAzureDatabaseOKBody struct { - // azure database instance AzureDatabaseInstance []*DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 `json:"azure_database_instance"` } @@ -499,11 +497,15 @@ func (o *DiscoverAzureDatabaseOKBody) validateAzureDatabaseInstance(formats strf if o.AzureDatabaseInstance[i] != nil { if err := o.AzureDatabaseInstance[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) } + return err } } @@ -528,9 +530,7 @@ func (o *DiscoverAzureDatabaseOKBody) ContextValidate(ctx context.Context, forma } func (o *DiscoverAzureDatabaseOKBody) contextValidateAzureDatabaseInstance(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.AzureDatabaseInstance); i++ { - if o.AzureDatabaseInstance[i] != nil { if swag.IsZero(o.AzureDatabaseInstance[i]) { // not required @@ -538,15 +538,18 @@ func (o *DiscoverAzureDatabaseOKBody) contextValidateAzureDatabaseInstance(ctx c } if err := o.AzureDatabaseInstance[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -575,7 +578,6 @@ DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 DiscoverAzureDatabaseInst swagger:model DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 */ type DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 struct { - // Azure database instance ID. InstanceID string `json:"instance_id,omitempty"` @@ -597,19 +599,19 @@ type DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 struct { // Environment tag. Environment string `json:"environment,omitempty"` - // Azure database availability zone. - Az string `json:"az,omitempty"` - - // Represents a purchasable Stock Keeping Unit (SKU) under a product. - // https://docs.microsoft.com/en-us/partner-center/develop/product-resources#sku. - NodeModel string `json:"node_model,omitempty"` - // DiscoverAzureDatabaseType describes supported Azure Database instance engines. // // - DISCOVER_AZURE_DATABASE_TYPE_MYSQL: MySQL type: microsoft.dbformysql or MariaDB type: microsoft.dbformariadb // - DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL: PostgreSQL type: microsoft.dbformysql // Enum: ["DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED","DISCOVER_AZURE_DATABASE_TYPE_MYSQL","DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL"] Type *string `json:"type,omitempty"` + + // Azure database availability zone. + Az string `json:"az,omitempty"` + + // Represents a purchasable Stock Keeping Unit (SKU) under a product. + // https://docs.microsoft.com/en-us/partner-center/develop/product-resources#sku. + NodeModel string `json:"node_model,omitempty"` } // Validate validates this discover azure database OK body azure database instance items0 @@ -626,7 +628,7 @@ func (o *DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0) Validate(format return nil } -var discoverAzureDatabaseOkBodyAzureDatabaseInstanceItems0TypeTypePropEnum []interface{} +var discoverAzureDatabaseOkBodyAzureDatabaseInstanceItems0TypeTypePropEnum []any func init() { var res []string diff --git a/api/management/v1/json/client/management_service/discover_rds_parameters.go b/api/management/v1/json/client/management_service/discover_rds_parameters.go index 93e9487d969..ef5c0058c50 100644 --- a/api/management/v1/json/client/management_service/discover_rds_parameters.go +++ b/api/management/v1/json/client/management_service/discover_rds_parameters.go @@ -60,7 +60,6 @@ DiscoverRDSParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type DiscoverRDSParams struct { - // Body. Body DiscoverRDSBody @@ -130,7 +129,6 @@ func (o *DiscoverRDSParams) SetBody(body DiscoverRDSBody) { // WriteToRequest writes these params to a swagger request func (o *DiscoverRDSParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/discover_rds_responses.go b/api/management/v1/json/client/management_service/discover_rds_responses.go index 6e80848a2e7..b8743c96b40 100644 --- a/api/management/v1/json/client/management_service/discover_rds_responses.go +++ b/api/management/v1/json/client/management_service/discover_rds_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +26,7 @@ type DiscoverRDSReader struct { } // ReadResponse reads a server response into the received o. -func (o *DiscoverRDSReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *DiscoverRDSReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewDiscoverRDSOK() @@ -104,11 +105,10 @@ func (o *DiscoverRDSOK) GetPayload() *DiscoverRDSOKBody { } func (o *DiscoverRDSOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(DiscoverRDSOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -178,11 +178,10 @@ func (o *DiscoverRDSDefault) GetPayload() *DiscoverRDSDefaultBody { } func (o *DiscoverRDSDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(DiscoverRDSDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -194,7 +193,6 @@ DiscoverRDSBody discover RDS body swagger:model DiscoverRDSBody */ type DiscoverRDSBody struct { - // AWS Access key. Optional. AWSAccessKey string `json:"aws_access_key,omitempty"` @@ -235,7 +233,6 @@ DiscoverRDSDefaultBody discover RDS default body swagger:model DiscoverRDSDefaultBody */ type DiscoverRDSDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -272,11 +269,15 @@ func (o *DiscoverRDSDefaultBody) validateDetails(formats strfmt.Registry) error if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -301,9 +302,7 @@ func (o *DiscoverRDSDefaultBody) ContextValidate(ctx context.Context, formats st } func (o *DiscoverRDSDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -311,15 +310,18 @@ func (o *DiscoverRDSDefaultBody) contextValidateDetails(ctx context.Context, for } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -348,19 +350,17 @@ DiscoverRDSDefaultBodyDetailsItems0 discover RDS default body details items0 swagger:model DiscoverRDSDefaultBodyDetailsItems0 */ type DiscoverRDSDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // discover RDS default body details items0 - DiscoverRDSDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + DiscoverRDSDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *DiscoverRDSDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -381,9 +381,9 @@ func (o *DiscoverRDSDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -398,7 +398,6 @@ func (o *DiscoverRDSDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // MarshalJSON marshals this object with additional properties into a JSON object func (o DiscoverRDSDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -462,7 +461,6 @@ DiscoverRDSOKBody discover RDS OK body swagger:model DiscoverRDSOKBody */ type DiscoverRDSOKBody struct { - // rds instances RDSInstances []*DiscoverRDSOKBodyRDSInstancesItems0 `json:"rds_instances"` } @@ -493,11 +491,15 @@ func (o *DiscoverRDSOKBody) validateRDSInstances(formats strfmt.Registry) error if o.RDSInstances[i] != nil { if err := o.RDSInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) } + return err } } @@ -522,9 +524,7 @@ func (o *DiscoverRDSOKBody) ContextValidate(ctx context.Context, formats strfmt. } func (o *DiscoverRDSOKBody) contextValidateRDSInstances(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.RDSInstances); i++ { - if o.RDSInstances[i] != nil { if swag.IsZero(o.RDSInstances[i]) { // not required @@ -532,15 +532,18 @@ func (o *DiscoverRDSOKBody) contextValidateRDSInstances(ctx context.Context, for } if err := o.RDSInstances[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -569,7 +572,6 @@ DiscoverRDSOKBodyRDSInstancesItems0 DiscoverRDSInstance models an unique RDS ins swagger:model DiscoverRDSOKBodyRDSInstancesItems0 */ type DiscoverRDSOKBodyRDSInstancesItems0 struct { - // AWS region. Region string `json:"region,omitempty"` @@ -588,12 +590,12 @@ type DiscoverRDSOKBodyRDSInstancesItems0 struct { // Access port. Port int64 `json:"port,omitempty"` - // Engine version. - EngineVersion string `json:"engine_version,omitempty"` - // DiscoverRDSEngine describes supported RDS instance engines. // Enum: ["DISCOVER_RDS_ENGINE_UNSPECIFIED","DISCOVER_RDS_ENGINE_MYSQL","DISCOVER_RDS_ENGINE_POSTGRESQL"] Engine *string `json:"engine,omitempty"` + + // Engine version. + EngineVersion string `json:"engine_version,omitempty"` } // Validate validates this discover RDS OK body RDS instances items0 @@ -610,7 +612,7 @@ func (o *DiscoverRDSOKBodyRDSInstancesItems0) Validate(formats strfmt.Registry) return nil } -var discoverRdsOkBodyRdsInstancesItems0TypeEnginePropEnum []interface{} +var discoverRdsOkBodyRdsInstancesItems0TypeEnginePropEnum []any func init() { var res []string diff --git a/api/management/v1/json/client/management_service/get_node_parameters.go b/api/management/v1/json/client/management_service/get_node_parameters.go index 73629cc22da..63aa4bdf7c6 100644 --- a/api/management/v1/json/client/management_service/get_node_parameters.go +++ b/api/management/v1/json/client/management_service/get_node_parameters.go @@ -60,7 +60,6 @@ GetNodeParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type GetNodeParams struct { - /* NodeID. Unique Node identifier. @@ -133,7 +132,6 @@ func (o *GetNodeParams) SetNodeID(nodeID string) { // WriteToRequest writes these params to a swagger request func (o *GetNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/get_node_responses.go b/api/management/v1/json/client/management_service/get_node_responses.go index aead75b9805..241eb92bed5 100644 --- a/api/management/v1/json/client/management_service/get_node_responses.go +++ b/api/management/v1/json/client/management_service/get_node_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +26,7 @@ type GetNodeReader struct { } // ReadResponse reads a server response into the received o. -func (o *GetNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *GetNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewGetNodeOK() @@ -104,11 +105,10 @@ func (o *GetNodeOK) GetPayload() *GetNodeOKBody { } func (o *GetNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetNodeOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -178,11 +178,10 @@ func (o *GetNodeDefault) GetPayload() *GetNodeDefaultBody { } func (o *GetNodeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetNodeDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -194,7 +193,6 @@ GetNodeDefaultBody get node default body swagger:model GetNodeDefaultBody */ type GetNodeDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -231,11 +229,15 @@ func (o *GetNodeDefaultBody) validateDetails(formats strfmt.Registry) error { if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -260,9 +262,7 @@ func (o *GetNodeDefaultBody) ContextValidate(ctx context.Context, formats strfmt } func (o *GetNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -270,15 +270,18 @@ func (o *GetNodeDefaultBody) contextValidateDetails(ctx context.Context, formats } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -307,19 +310,17 @@ GetNodeDefaultBodyDetailsItems0 get node default body details items0 swagger:model GetNodeDefaultBodyDetailsItems0 */ type GetNodeDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // get node default body details items0 - GetNodeDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + GetNodeDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *GetNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -340,9 +341,9 @@ func (o *GetNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -357,7 +358,6 @@ func (o *GetNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // MarshalJSON marshals this object with additional properties into a JSON object func (o GetNodeDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -421,7 +421,6 @@ GetNodeOKBody get node OK body swagger:model GetNodeOKBody */ type GetNodeOKBody struct { - // node Node *GetNodeOKBodyNode `json:"node,omitempty"` } @@ -447,11 +446,15 @@ func (o *GetNodeOKBody) validateNode(formats strfmt.Registry) error { if o.Node != nil { if err := o.Node.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("getNodeOk" + "." + "node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("getNodeOk" + "." + "node") } + return err } } @@ -474,7 +477,6 @@ func (o *GetNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Regi } func (o *GetNodeOKBody) contextValidateNode(ctx context.Context, formats strfmt.Registry) error { - if o.Node != nil { if swag.IsZero(o.Node) { // not required @@ -482,11 +484,15 @@ func (o *GetNodeOKBody) contextValidateNode(ctx context.Context, formats strfmt. } if err := o.Node.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("getNodeOk" + "." + "node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("getNodeOk" + "." + "node") } + return err } } @@ -517,7 +523,6 @@ GetNodeOKBodyNode get node OK body node swagger:model GetNodeOKBodyNode */ type GetNodeOKBodyNode struct { - // Unique Node identifier. NodeID string `json:"node_id,omitempty"` @@ -562,6 +567,15 @@ type GetNodeOKBodyNode struct { // Format: date-time UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` + // Node status. + // + // - STATUS_UNSPECIFIED: Invalid status. + // - STATUS_UP: The node is up. + // - STATUS_DOWN: The node is down. + // - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet). + // Enum: ["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` + // List of agents related to this node. Agents []*GetNodeOKBodyNodeAgentsItems0 `json:"agents"` @@ -573,15 +587,6 @@ type GetNodeOKBodyNode struct { // True if this node is a PMM Server node (HA mode). IsPMMServerNode bool `json:"is_pmm_server_node,omitempty"` - - // Node status. - // - // - STATUS_UNSPECIFIED: Invalid status. - // - STATUS_UP: The node is up. - // - STATUS_DOWN: The node is down. - // - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet). - // Enum: ["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` } // Validate validates this get node OK body node @@ -596,15 +601,15 @@ func (o *GetNodeOKBodyNode) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateAgents(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateServices(formats); err != nil { + if err := o.validateAgents(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateServices(formats); err != nil { res = append(res, err) } @@ -638,6 +643,54 @@ func (o *GetNodeOKBodyNode) validateUpdatedAt(formats strfmt.Registry) error { return nil } +var getNodeOkBodyNodeTypeStatusPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + getNodeOkBodyNodeTypeStatusPropEnum = append(getNodeOkBodyNodeTypeStatusPropEnum, v) + } +} + +const ( + + // GetNodeOKBodyNodeStatusSTATUSUNSPECIFIED captures enum value "STATUS_UNSPECIFIED" + GetNodeOKBodyNodeStatusSTATUSUNSPECIFIED string = "STATUS_UNSPECIFIED" + + // GetNodeOKBodyNodeStatusSTATUSUP captures enum value "STATUS_UP" + GetNodeOKBodyNodeStatusSTATUSUP string = "STATUS_UP" + + // GetNodeOKBodyNodeStatusSTATUSDOWN captures enum value "STATUS_DOWN" + GetNodeOKBodyNodeStatusSTATUSDOWN string = "STATUS_DOWN" + + // GetNodeOKBodyNodeStatusSTATUSUNKNOWN captures enum value "STATUS_UNKNOWN" + GetNodeOKBodyNodeStatusSTATUSUNKNOWN string = "STATUS_UNKNOWN" +) + +// prop value enum +func (o *GetNodeOKBodyNode) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, getNodeOkBodyNodeTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *GetNodeOKBodyNode) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("getNodeOk"+"."+"node"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + func (o *GetNodeOKBodyNode) validateAgents(formats strfmt.Registry) error { if swag.IsZero(o.Agents) { // not required return nil @@ -650,11 +703,15 @@ func (o *GetNodeOKBodyNode) validateAgents(formats strfmt.Registry) error { if o.Agents[i] != nil { if err := o.Agents[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("getNodeOk" + "." + "node" + "." + "agents" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("getNodeOk" + "." + "node" + "." + "agents" + "." + strconv.Itoa(i)) } + return err } } @@ -676,11 +733,15 @@ func (o *GetNodeOKBodyNode) validateServices(formats strfmt.Registry) error { if o.Services[i] != nil { if err := o.Services[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("getNodeOk" + "." + "node" + "." + "services" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("getNodeOk" + "." + "node" + "." + "services" + "." + strconv.Itoa(i)) } + return err } } @@ -690,54 +751,6 @@ func (o *GetNodeOKBodyNode) validateServices(formats strfmt.Registry) error { return nil } -var getNodeOkBodyNodeTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - getNodeOkBodyNodeTypeStatusPropEnum = append(getNodeOkBodyNodeTypeStatusPropEnum, v) - } -} - -const ( - - // GetNodeOKBodyNodeStatusSTATUSUNSPECIFIED captures enum value "STATUS_UNSPECIFIED" - GetNodeOKBodyNodeStatusSTATUSUNSPECIFIED string = "STATUS_UNSPECIFIED" - - // GetNodeOKBodyNodeStatusSTATUSUP captures enum value "STATUS_UP" - GetNodeOKBodyNodeStatusSTATUSUP string = "STATUS_UP" - - // GetNodeOKBodyNodeStatusSTATUSDOWN captures enum value "STATUS_DOWN" - GetNodeOKBodyNodeStatusSTATUSDOWN string = "STATUS_DOWN" - - // GetNodeOKBodyNodeStatusSTATUSUNKNOWN captures enum value "STATUS_UNKNOWN" - GetNodeOKBodyNodeStatusSTATUSUNKNOWN string = "STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetNodeOKBodyNode) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getNodeOkBodyNodeTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetNodeOKBodyNode) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getNodeOk"+"."+"node"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - // ContextValidate validate this get node OK body node based on the context it is used func (o *GetNodeOKBodyNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -757,9 +770,7 @@ func (o *GetNodeOKBodyNode) ContextValidate(ctx context.Context, formats strfmt. } func (o *GetNodeOKBodyNode) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Agents); i++ { - if o.Agents[i] != nil { if swag.IsZero(o.Agents[i]) { // not required @@ -767,24 +778,25 @@ func (o *GetNodeOKBodyNode) contextValidateAgents(ctx context.Context, formats s } if err := o.Agents[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("getNodeOk" + "." + "node" + "." + "agents" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("getNodeOk" + "." + "node" + "." + "agents" + "." + strconv.Itoa(i)) } + return err } } - } return nil } func (o *GetNodeOKBodyNode) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Services); i++ { - if o.Services[i] != nil { if swag.IsZero(o.Services[i]) { // not required @@ -792,15 +804,18 @@ func (o *GetNodeOKBodyNode) contextValidateServices(ctx context.Context, formats } if err := o.Services[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("getNodeOk" + "." + "node" + "." + "services" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("getNodeOk" + "." + "node" + "." + "services" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -829,7 +844,6 @@ GetNodeOKBodyNodeAgentsItems0 get node OK body node agents items0 swagger:model GetNodeOKBodyNodeAgentsItems0 */ type GetNodeOKBodyNodeAgentsItems0 struct { - // Unique Agent identifier. AgentID string `json:"agent_id,omitempty"` @@ -876,7 +890,6 @@ GetNodeOKBodyNodeServicesItems0 Service represents a service running on a node. swagger:model GetNodeOKBodyNodeServicesItems0 */ type GetNodeOKBodyNodeServicesItems0 struct { - // Unique Service identifier. ServiceID string `json:"service_id,omitempty"` diff --git a/api/management/v1/json/client/management_service/list_agent_versions_parameters.go b/api/management/v1/json/client/management_service/list_agent_versions_parameters.go index 97d2ce24b71..d7f16fa9b2d 100644 --- a/api/management/v1/json/client/management_service/list_agent_versions_parameters.go +++ b/api/management/v1/json/client/management_service/list_agent_versions_parameters.go @@ -115,7 +115,6 @@ func (o *ListAgentVersionsParams) SetHTTPClient(client *http.Client) { // WriteToRequest writes these params to a swagger request func (o *ListAgentVersionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/list_agent_versions_responses.go b/api/management/v1/json/client/management_service/list_agent_versions_responses.go index af03219404b..a0a8858d962 100644 --- a/api/management/v1/json/client/management_service/list_agent_versions_responses.go +++ b/api/management/v1/json/client/management_service/list_agent_versions_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +26,7 @@ type ListAgentVersionsReader struct { } // ReadResponse reads a server response into the received o. -func (o *ListAgentVersionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ListAgentVersionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewListAgentVersionsOK() @@ -104,11 +105,10 @@ func (o *ListAgentVersionsOK) GetPayload() *ListAgentVersionsOKBody { } func (o *ListAgentVersionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListAgentVersionsOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -178,11 +178,10 @@ func (o *ListAgentVersionsDefault) GetPayload() *ListAgentVersionsDefaultBody { } func (o *ListAgentVersionsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListAgentVersionsDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -194,7 +193,6 @@ ListAgentVersionsDefaultBody list agent versions default body swagger:model ListAgentVersionsDefaultBody */ type ListAgentVersionsDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -231,11 +229,15 @@ func (o *ListAgentVersionsDefaultBody) validateDetails(formats strfmt.Registry) if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ListAgentVersions default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ListAgentVersions default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -260,9 +262,7 @@ func (o *ListAgentVersionsDefaultBody) ContextValidate(ctx context.Context, form } func (o *ListAgentVersionsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -270,15 +270,18 @@ func (o *ListAgentVersionsDefaultBody) contextValidateDetails(ctx context.Contex } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ListAgentVersions default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ListAgentVersions default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -307,19 +310,17 @@ ListAgentVersionsDefaultBodyDetailsItems0 list agent versions default body detai swagger:model ListAgentVersionsDefaultBodyDetailsItems0 */ type ListAgentVersionsDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // list agent versions default body details items0 - ListAgentVersionsDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + ListAgentVersionsDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *ListAgentVersionsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -340,9 +341,9 @@ func (o *ListAgentVersionsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) e delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -357,7 +358,6 @@ func (o *ListAgentVersionsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) e // MarshalJSON marshals this object with additional properties into a JSON object func (o ListAgentVersionsDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -421,7 +421,6 @@ ListAgentVersionsOKBody list agent versions OK body swagger:model ListAgentVersionsOKBody */ type ListAgentVersionsOKBody struct { - // List of Agent versions. AgentVersions []*ListAgentVersionsOKBodyAgentVersionsItems0 `json:"agent_versions"` } @@ -452,11 +451,15 @@ func (o *ListAgentVersionsOKBody) validateAgentVersions(formats strfmt.Registry) if o.AgentVersions[i] != nil { if err := o.AgentVersions[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("listAgentVersionsOk" + "." + "agent_versions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("listAgentVersionsOk" + "." + "agent_versions" + "." + strconv.Itoa(i)) } + return err } } @@ -481,9 +484,7 @@ func (o *ListAgentVersionsOKBody) ContextValidate(ctx context.Context, formats s } func (o *ListAgentVersionsOKBody) contextValidateAgentVersions(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.AgentVersions); i++ { - if o.AgentVersions[i] != nil { if swag.IsZero(o.AgentVersions[i]) { // not required @@ -491,15 +492,18 @@ func (o *ListAgentVersionsOKBody) contextValidateAgentVersions(ctx context.Conte } if err := o.AgentVersions[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("listAgentVersionsOk" + "." + "agent_versions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("listAgentVersionsOk" + "." + "agent_versions" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -528,7 +532,6 @@ ListAgentVersionsOKBodyAgentVersionsItems0 list agent versions OK body agent ver swagger:model ListAgentVersionsOKBodyAgentVersionsItems0 */ type ListAgentVersionsOKBodyAgentVersionsItems0 struct { - // Agent ID. AgentID string `json:"agent_id,omitempty"` @@ -560,7 +563,7 @@ func (o *ListAgentVersionsOKBodyAgentVersionsItems0) Validate(formats strfmt.Reg return nil } -var listAgentVersionsOkBodyAgentVersionsItems0TypeSeverityPropEnum []interface{} +var listAgentVersionsOkBodyAgentVersionsItems0TypeSeverityPropEnum []any func init() { var res []string diff --git a/api/management/v1/json/client/management_service/list_agents_parameters.go b/api/management/v1/json/client/management_service/list_agents_parameters.go index 7c16816c10a..5dd7b7b6a4f 100644 --- a/api/management/v1/json/client/management_service/list_agents_parameters.go +++ b/api/management/v1/json/client/management_service/list_agents_parameters.go @@ -60,7 +60,6 @@ ListAgentsParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type ListAgentsParams struct { - /* NodeID. Return only Agents that relate to a specific NodeID. @@ -150,7 +149,6 @@ func (o *ListAgentsParams) SetServiceID(serviceID *string) { // WriteToRequest writes these params to a swagger request func (o *ListAgentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } @@ -166,7 +164,6 @@ func (o *ListAgentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re } qNodeID := qrNodeID if qNodeID != "" { - if err := r.SetQueryParam("node_id", qNodeID); err != nil { return err } @@ -183,7 +180,6 @@ func (o *ListAgentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re } qServiceID := qrServiceID if qServiceID != "" { - if err := r.SetQueryParam("service_id", qServiceID); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/list_agents_responses.go b/api/management/v1/json/client/management_service/list_agents_responses.go index ebe0b523dbd..2da78ec1324 100644 --- a/api/management/v1/json/client/management_service/list_agents_responses.go +++ b/api/management/v1/json/client/management_service/list_agents_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +26,7 @@ type ListAgentsReader struct { } // ReadResponse reads a server response into the received o. -func (o *ListAgentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ListAgentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewListAgentsOK() @@ -104,11 +105,10 @@ func (o *ListAgentsOK) GetPayload() *ListAgentsOKBody { } func (o *ListAgentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListAgentsOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -178,11 +178,10 @@ func (o *ListAgentsDefault) GetPayload() *ListAgentsDefaultBody { } func (o *ListAgentsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListAgentsDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -194,7 +193,6 @@ ListAgentsDefaultBody list agents default body swagger:model ListAgentsDefaultBody */ type ListAgentsDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -231,11 +229,15 @@ func (o *ListAgentsDefaultBody) validateDetails(formats strfmt.Registry) error { if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -260,9 +262,7 @@ func (o *ListAgentsDefaultBody) ContextValidate(ctx context.Context, formats str } func (o *ListAgentsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -270,15 +270,18 @@ func (o *ListAgentsDefaultBody) contextValidateDetails(ctx context.Context, form } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -307,19 +310,17 @@ ListAgentsDefaultBodyDetailsItems0 list agents default body details items0 swagger:model ListAgentsDefaultBodyDetailsItems0 */ type ListAgentsDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // list agents default body details items0 - ListAgentsDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + ListAgentsDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *ListAgentsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -340,9 +341,9 @@ func (o *ListAgentsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -357,7 +358,6 @@ func (o *ListAgentsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // MarshalJSON marshals this object with additional properties into a JSON object func (o ListAgentsDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -421,7 +421,6 @@ ListAgentsOKBody list agents OK body swagger:model ListAgentsOKBody */ type ListAgentsOKBody struct { - // List of Agents. Agents []*ListAgentsOKBodyAgentsItems0 `json:"agents"` } @@ -452,11 +451,15 @@ func (o *ListAgentsOKBody) validateAgents(formats strfmt.Registry) error { if o.Agents[i] != nil { if err := o.Agents[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("listAgentsOk" + "." + "agents" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("listAgentsOk" + "." + "agents" + "." + strconv.Itoa(i)) } + return err } } @@ -481,9 +484,7 @@ func (o *ListAgentsOKBody) ContextValidate(ctx context.Context, formats strfmt.R } func (o *ListAgentsOKBody) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Agents); i++ { - if o.Agents[i] != nil { if swag.IsZero(o.Agents[i]) { // not required @@ -491,15 +492,18 @@ func (o *ListAgentsOKBody) contextValidateAgents(ctx context.Context, formats st } if err := o.Agents[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("listAgentsOk" + "." + "agents" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("listAgentsOk" + "." + "agents" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -528,7 +532,6 @@ ListAgentsOKBodyAgentsItems0 list agents OK body agents items0 swagger:model ListAgentsOKBodyAgentsItems0 */ type ListAgentsOKBodyAgentsItems0 struct { - // Unique agent identifier. AgentID string `json:"agent_id,omitempty"` @@ -560,6 +563,12 @@ type ListAgentsOKBodyAgentsItems0 struct { // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // Limit query length in QAN. MaxQueryLength int32 `json:"max_query_length,omitempty"` @@ -638,15 +647,12 @@ type ListAgentsOKBodyAgentsItems0 struct { // True if an exporter agent is exposed on all host addresses. ExposeExporter bool `json:"expose_exporter,omitempty"` + // valkey options + ValkeyOptions any `json:"valkey_options,omitempty"` + // azure options AzureOptions *ListAgentsOKBodyAgentsItems0AzureOptions `json:"azure_options,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // mongo db options MongoDBOptions *ListAgentsOKBodyAgentsItems0MongoDBOptions `json:"mongo_db_options,omitempty"` @@ -658,9 +664,6 @@ type ListAgentsOKBodyAgentsItems0 struct { // rta options RtaOptions *ListAgentsOKBodyAgentsItems0RtaOptions `json:"rta_options,omitempty"` - - // valkey options - ValkeyOptions interface{} `json:"valkey_options,omitempty"` } // Validate validates this list agents OK body agents items0 @@ -671,15 +674,15 @@ func (o *ListAgentsOKBodyAgentsItems0) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateUpdatedAt(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateAzureOptions(formats); err != nil { + if err := o.validateUpdatedAt(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateAzureOptions(formats); err != nil { res = append(res, err) } @@ -717,38 +720,7 @@ func (o *ListAgentsOKBodyAgentsItems0) validateCreatedAt(formats strfmt.Registry return nil } -func (o *ListAgentsOKBodyAgentsItems0) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updated_at", "body", "date-time", o.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListAgentsOKBodyAgentsItems0) validateAzureOptions(formats strfmt.Registry) error { - if swag.IsZero(o.AzureOptions) { // not required - return nil - } - - if o.AzureOptions != nil { - if err := o.AzureOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("azure_options") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("azure_options") - } - return err - } - } - - return nil -} - -var listAgentsOkBodyAgentsItems0TypeLogLevelPropEnum []interface{} +var listAgentsOkBodyAgentsItems0TypeLogLevelPropEnum []any func init() { var res []string @@ -802,6 +774,41 @@ func (o *ListAgentsOKBodyAgentsItems0) validateLogLevel(formats strfmt.Registry) return nil } +func (o *ListAgentsOKBodyAgentsItems0) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(o.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updated_at", "body", "date-time", o.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ListAgentsOKBodyAgentsItems0) validateAzureOptions(formats strfmt.Registry) error { + if swag.IsZero(o.AzureOptions) { // not required + return nil + } + + if o.AzureOptions != nil { + if err := o.AzureOptions.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("azure_options") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("azure_options") + } + + return err + } + } + + return nil +} + func (o *ListAgentsOKBodyAgentsItems0) validateMongoDBOptions(formats strfmt.Registry) error { if swag.IsZero(o.MongoDBOptions) { // not required return nil @@ -809,11 +816,15 @@ func (o *ListAgentsOKBodyAgentsItems0) validateMongoDBOptions(formats strfmt.Reg if o.MongoDBOptions != nil { if err := o.MongoDBOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("mongo_db_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("mongo_db_options") } + return err } } @@ -828,11 +839,15 @@ func (o *ListAgentsOKBodyAgentsItems0) validateMysqlOptions(formats strfmt.Regis if o.MysqlOptions != nil { if err := o.MysqlOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("mysql_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("mysql_options") } + return err } } @@ -847,11 +862,15 @@ func (o *ListAgentsOKBodyAgentsItems0) validatePostgresqlOptions(formats strfmt. if o.PostgresqlOptions != nil { if err := o.PostgresqlOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("postgresql_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("postgresql_options") } + return err } } @@ -866,11 +885,15 @@ func (o *ListAgentsOKBodyAgentsItems0) validateRtaOptions(formats strfmt.Registr if o.RtaOptions != nil { if err := o.RtaOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("rta_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("rta_options") } + return err } } @@ -909,7 +932,6 @@ func (o *ListAgentsOKBodyAgentsItems0) ContextValidate(ctx context.Context, form } func (o *ListAgentsOKBodyAgentsItems0) contextValidateAzureOptions(ctx context.Context, formats strfmt.Registry) error { - if o.AzureOptions != nil { if swag.IsZero(o.AzureOptions) { // not required @@ -917,11 +939,15 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateAzureOptions(ctx context.C } if err := o.AzureOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("azure_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("azure_options") } + return err } } @@ -930,7 +956,6 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateAzureOptions(ctx context.C } func (o *ListAgentsOKBodyAgentsItems0) contextValidateMongoDBOptions(ctx context.Context, formats strfmt.Registry) error { - if o.MongoDBOptions != nil { if swag.IsZero(o.MongoDBOptions) { // not required @@ -938,11 +963,15 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateMongoDBOptions(ctx context } if err := o.MongoDBOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("mongo_db_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("mongo_db_options") } + return err } } @@ -951,7 +980,6 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateMongoDBOptions(ctx context } func (o *ListAgentsOKBodyAgentsItems0) contextValidateMysqlOptions(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlOptions != nil { if swag.IsZero(o.MysqlOptions) { // not required @@ -959,11 +987,15 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateMysqlOptions(ctx context.C } if err := o.MysqlOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("mysql_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("mysql_options") } + return err } } @@ -972,7 +1004,6 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateMysqlOptions(ctx context.C } func (o *ListAgentsOKBodyAgentsItems0) contextValidatePostgresqlOptions(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresqlOptions != nil { if swag.IsZero(o.PostgresqlOptions) { // not required @@ -980,11 +1011,15 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidatePostgresqlOptions(ctx cont } if err := o.PostgresqlOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("postgresql_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("postgresql_options") } + return err } } @@ -993,7 +1028,6 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidatePostgresqlOptions(ctx cont } func (o *ListAgentsOKBodyAgentsItems0) contextValidateRtaOptions(ctx context.Context, formats strfmt.Registry) error { - if o.RtaOptions != nil { if swag.IsZero(o.RtaOptions) { // not required @@ -1001,11 +1035,15 @@ func (o *ListAgentsOKBodyAgentsItems0) contextValidateRtaOptions(ctx context.Con } if err := o.RtaOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("rta_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("rta_options") } + return err } } @@ -1036,7 +1074,6 @@ ListAgentsOKBodyAgentsItems0AzureOptions list agents OK body agents items0 azure swagger:model ListAgentsOKBodyAgentsItems0AzureOptions */ type ListAgentsOKBodyAgentsItems0AzureOptions struct { - // Azure client ID. ClientID string `json:"client_id,omitempty"` @@ -1086,7 +1123,6 @@ ListAgentsOKBodyAgentsItems0MongoDBOptions list agents OK body agents items0 mon swagger:model ListAgentsOKBodyAgentsItems0MongoDBOptions */ type ListAgentsOKBodyAgentsItems0MongoDBOptions struct { - // True if TLS certificate is set. IsTLSCertificateKeySet bool `json:"is_tls_certificate_key_set,omitempty"` @@ -1142,7 +1178,6 @@ ListAgentsOKBodyAgentsItems0MysqlOptions list agents OK body agents items0 mysql swagger:model ListAgentsOKBodyAgentsItems0MysqlOptions */ type ListAgentsOKBodyAgentsItems0MysqlOptions struct { - // True if TLS key is set. IsTLSKeySet bool `json:"is_tls_key_set,omitempty"` @@ -1183,7 +1218,6 @@ ListAgentsOKBodyAgentsItems0PostgresqlOptions list agents OK body agents items0 swagger:model ListAgentsOKBodyAgentsItems0PostgresqlOptions */ type ListAgentsOKBodyAgentsItems0PostgresqlOptions struct { - // True if TLS key is set. IsSslKeySet bool `json:"is_ssl_key_set,omitempty"` @@ -1227,7 +1261,6 @@ ListAgentsOKBodyAgentsItems0RtaOptions RTAOptions holds Real-Time Query Analytic swagger:model ListAgentsOKBodyAgentsItems0RtaOptions */ type ListAgentsOKBodyAgentsItems0RtaOptions struct { - // Query collect interval (default 2s is set by server). CollectInterval string `json:"collect_interval,omitempty"` } diff --git a/api/management/v1/json/client/management_service/list_nodes_parameters.go b/api/management/v1/json/client/management_service/list_nodes_parameters.go index eeca2a1f5f7..441e42660e2 100644 --- a/api/management/v1/json/client/management_service/list_nodes_parameters.go +++ b/api/management/v1/json/client/management_service/list_nodes_parameters.go @@ -60,7 +60,6 @@ ListNodesParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type ListNodesParams struct { - /* NodeType. Node type to be filtered out. @@ -86,9 +85,7 @@ func (o *ListNodesParams) WithDefaults() *ListNodesParams { // // All values with no default are reset to their zero value. func (o *ListNodesParams) SetDefaults() { - var ( - nodeTypeDefault = string("NODE_TYPE_UNSPECIFIED") - ) + nodeTypeDefault := string("NODE_TYPE_UNSPECIFIED") val := ListNodesParams{ NodeType: &nodeTypeDefault, @@ -146,7 +143,6 @@ func (o *ListNodesParams) SetNodeType(nodeType *string) { // WriteToRequest writes these params to a swagger request func (o *ListNodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } @@ -162,7 +158,6 @@ func (o *ListNodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg } qNodeType := qrNodeType if qNodeType != "" { - if err := r.SetQueryParam("node_type", qNodeType); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/list_nodes_responses.go b/api/management/v1/json/client/management_service/list_nodes_responses.go index b1f9404e42f..d9f378b0034 100644 --- a/api/management/v1/json/client/management_service/list_nodes_responses.go +++ b/api/management/v1/json/client/management_service/list_nodes_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +26,7 @@ type ListNodesReader struct { } // ReadResponse reads a server response into the received o. -func (o *ListNodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ListNodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewListNodesOK() @@ -104,11 +105,10 @@ func (o *ListNodesOK) GetPayload() *ListNodesOKBody { } func (o *ListNodesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListNodesOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -178,11 +178,10 @@ func (o *ListNodesDefault) GetPayload() *ListNodesDefaultBody { } func (o *ListNodesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListNodesDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -194,7 +193,6 @@ ListNodesDefaultBody list nodes default body swagger:model ListNodesDefaultBody */ type ListNodesDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -231,11 +229,15 @@ func (o *ListNodesDefaultBody) validateDetails(formats strfmt.Registry) error { if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -260,9 +262,7 @@ func (o *ListNodesDefaultBody) ContextValidate(ctx context.Context, formats strf } func (o *ListNodesDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -270,15 +270,18 @@ func (o *ListNodesDefaultBody) contextValidateDetails(ctx context.Context, forma } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -307,19 +310,17 @@ ListNodesDefaultBodyDetailsItems0 list nodes default body details items0 swagger:model ListNodesDefaultBodyDetailsItems0 */ type ListNodesDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // list nodes default body details items0 - ListNodesDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + ListNodesDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *ListNodesDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -340,9 +341,9 @@ func (o *ListNodesDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -357,7 +358,6 @@ func (o *ListNodesDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // MarshalJSON marshals this object with additional properties into a JSON object func (o ListNodesDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -421,7 +421,6 @@ ListNodesOKBody list nodes OK body swagger:model ListNodesOKBody */ type ListNodesOKBody struct { - // nodes Nodes []*ListNodesOKBodyNodesItems0 `json:"nodes"` } @@ -452,11 +451,15 @@ func (o *ListNodesOKBody) validateNodes(formats strfmt.Registry) error { if o.Nodes[i] != nil { if err := o.Nodes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("listNodesOk" + "." + "nodes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("listNodesOk" + "." + "nodes" + "." + strconv.Itoa(i)) } + return err } } @@ -481,9 +484,7 @@ func (o *ListNodesOKBody) ContextValidate(ctx context.Context, formats strfmt.Re } func (o *ListNodesOKBody) contextValidateNodes(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Nodes); i++ { - if o.Nodes[i] != nil { if swag.IsZero(o.Nodes[i]) { // not required @@ -491,15 +492,18 @@ func (o *ListNodesOKBody) contextValidateNodes(ctx context.Context, formats strf } if err := o.Nodes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("listNodesOk" + "." + "nodes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("listNodesOk" + "." + "nodes" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -528,7 +532,6 @@ ListNodesOKBodyNodesItems0 list nodes OK body nodes items0 swagger:model ListNodesOKBodyNodesItems0 */ type ListNodesOKBodyNodesItems0 struct { - // Unique Node identifier. NodeID string `json:"node_id,omitempty"` @@ -573,6 +576,15 @@ type ListNodesOKBodyNodesItems0 struct { // Format: date-time UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` + // Node status. + // + // - STATUS_UNSPECIFIED: Invalid status. + // - STATUS_UP: The node is up. + // - STATUS_DOWN: The node is down. + // - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet). + // Enum: ["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"] + Status *string `json:"status,omitempty"` + // List of agents related to this node. Agents []*ListNodesOKBodyNodesItems0AgentsItems0 `json:"agents"` @@ -584,15 +596,6 @@ type ListNodesOKBodyNodesItems0 struct { // True if this node is a PMM Server node (HA mode). IsPMMServerNode bool `json:"is_pmm_server_node,omitempty"` - - // Node status. - // - // - STATUS_UNSPECIFIED: Invalid status. - // - STATUS_UP: The node is up. - // - STATUS_DOWN: The node is down. - // - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet). - // Enum: ["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"] - Status *string `json:"status,omitempty"` } // Validate validates this list nodes OK body nodes items0 @@ -607,15 +610,15 @@ func (o *ListNodesOKBodyNodesItems0) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateAgents(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } - if err := o.validateServices(formats); err != nil { + if err := o.validateAgents(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateServices(formats); err != nil { res = append(res, err) } @@ -649,6 +652,54 @@ func (o *ListNodesOKBodyNodesItems0) validateUpdatedAt(formats strfmt.Registry) return nil } +var listNodesOkBodyNodesItems0TypeStatusPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + listNodesOkBodyNodesItems0TypeStatusPropEnum = append(listNodesOkBodyNodesItems0TypeStatusPropEnum, v) + } +} + +const ( + + // ListNodesOKBodyNodesItems0StatusSTATUSUNSPECIFIED captures enum value "STATUS_UNSPECIFIED" + ListNodesOKBodyNodesItems0StatusSTATUSUNSPECIFIED string = "STATUS_UNSPECIFIED" + + // ListNodesOKBodyNodesItems0StatusSTATUSUP captures enum value "STATUS_UP" + ListNodesOKBodyNodesItems0StatusSTATUSUP string = "STATUS_UP" + + // ListNodesOKBodyNodesItems0StatusSTATUSDOWN captures enum value "STATUS_DOWN" + ListNodesOKBodyNodesItems0StatusSTATUSDOWN string = "STATUS_DOWN" + + // ListNodesOKBodyNodesItems0StatusSTATUSUNKNOWN captures enum value "STATUS_UNKNOWN" + ListNodesOKBodyNodesItems0StatusSTATUSUNKNOWN string = "STATUS_UNKNOWN" +) + +// prop value enum +func (o *ListNodesOKBodyNodesItems0) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listNodesOkBodyNodesItems0TypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *ListNodesOKBodyNodesItems0) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + // value enum + if err := o.validateStatusEnum("status", "body", *o.Status); err != nil { + return err + } + + return nil +} + func (o *ListNodesOKBodyNodesItems0) validateAgents(formats strfmt.Registry) error { if swag.IsZero(o.Agents) { // not required return nil @@ -661,11 +712,15 @@ func (o *ListNodesOKBodyNodesItems0) validateAgents(formats strfmt.Registry) err if o.Agents[i] != nil { if err := o.Agents[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("agents" + "." + strconv.Itoa(i)) } + return err } } @@ -687,11 +742,15 @@ func (o *ListNodesOKBodyNodesItems0) validateServices(formats strfmt.Registry) e if o.Services[i] != nil { if err := o.Services[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("services" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("services" + "." + strconv.Itoa(i)) } + return err } } @@ -701,54 +760,6 @@ func (o *ListNodesOKBodyNodesItems0) validateServices(formats strfmt.Registry) e return nil } -var listNodesOkBodyNodesItems0TypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listNodesOkBodyNodesItems0TypeStatusPropEnum = append(listNodesOkBodyNodesItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListNodesOKBodyNodesItems0StatusSTATUSUNSPECIFIED captures enum value "STATUS_UNSPECIFIED" - ListNodesOKBodyNodesItems0StatusSTATUSUNSPECIFIED string = "STATUS_UNSPECIFIED" - - // ListNodesOKBodyNodesItems0StatusSTATUSUP captures enum value "STATUS_UP" - ListNodesOKBodyNodesItems0StatusSTATUSUP string = "STATUS_UP" - - // ListNodesOKBodyNodesItems0StatusSTATUSDOWN captures enum value "STATUS_DOWN" - ListNodesOKBodyNodesItems0StatusSTATUSDOWN string = "STATUS_DOWN" - - // ListNodesOKBodyNodesItems0StatusSTATUSUNKNOWN captures enum value "STATUS_UNKNOWN" - ListNodesOKBodyNodesItems0StatusSTATUSUNKNOWN string = "STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListNodesOKBodyNodesItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listNodesOkBodyNodesItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListNodesOKBodyNodesItems0) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("status", "body", *o.Status); err != nil { - return err - } - - return nil -} - // ContextValidate validate this list nodes OK body nodes items0 based on the context it is used func (o *ListNodesOKBodyNodesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -768,9 +779,7 @@ func (o *ListNodesOKBodyNodesItems0) ContextValidate(ctx context.Context, format } func (o *ListNodesOKBodyNodesItems0) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Agents); i++ { - if o.Agents[i] != nil { if swag.IsZero(o.Agents[i]) { // not required @@ -778,24 +787,25 @@ func (o *ListNodesOKBodyNodesItems0) contextValidateAgents(ctx context.Context, } if err := o.Agents[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("agents" + "." + strconv.Itoa(i)) } + return err } } - } return nil } func (o *ListNodesOKBodyNodesItems0) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Services); i++ { - if o.Services[i] != nil { if swag.IsZero(o.Services[i]) { // not required @@ -803,15 +813,18 @@ func (o *ListNodesOKBodyNodesItems0) contextValidateServices(ctx context.Context } if err := o.Services[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("services" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("services" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -840,7 +853,6 @@ ListNodesOKBodyNodesItems0AgentsItems0 list nodes OK body nodes items0 agents it swagger:model ListNodesOKBodyNodesItems0AgentsItems0 */ type ListNodesOKBodyNodesItems0AgentsItems0 struct { - // Unique Agent identifier. AgentID string `json:"agent_id,omitempty"` @@ -887,7 +899,6 @@ ListNodesOKBodyNodesItems0ServicesItems0 Service represents a service running on swagger:model ListNodesOKBodyNodesItems0ServicesItems0 */ type ListNodesOKBodyNodesItems0ServicesItems0 struct { - // Unique Service identifier. ServiceID string `json:"service_id,omitempty"` diff --git a/api/management/v1/json/client/management_service/list_services_parameters.go b/api/management/v1/json/client/management_service/list_services_parameters.go index d9a1cba1032..80363638efa 100644 --- a/api/management/v1/json/client/management_service/list_services_parameters.go +++ b/api/management/v1/json/client/management_service/list_services_parameters.go @@ -60,7 +60,6 @@ ListServicesParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type ListServicesParams struct { - /* ExternalGroup. Return only services in this external group. @@ -98,9 +97,7 @@ func (o *ListServicesParams) WithDefaults() *ListServicesParams { // // All values with no default are reset to their zero value. func (o *ListServicesParams) SetDefaults() { - var ( - serviceTypeDefault = string("SERVICE_TYPE_UNSPECIFIED") - ) + serviceTypeDefault := string("SERVICE_TYPE_UNSPECIFIED") val := ListServicesParams{ ServiceType: &serviceTypeDefault, @@ -180,7 +177,6 @@ func (o *ListServicesParams) SetServiceType(serviceType *string) { // WriteToRequest writes these params to a swagger request func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } @@ -196,7 +192,6 @@ func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } qExternalGroup := qrExternalGroup if qExternalGroup != "" { - if err := r.SetQueryParam("external_group", qExternalGroup); err != nil { return err } @@ -213,7 +208,6 @@ func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } qNodeID := qrNodeID if qNodeID != "" { - if err := r.SetQueryParam("node_id", qNodeID); err != nil { return err } @@ -230,7 +224,6 @@ func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } qServiceType := qrServiceType if qServiceType != "" { - if err := r.SetQueryParam("service_type", qServiceType); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/list_services_responses.go b/api/management/v1/json/client/management_service/list_services_responses.go index 40507cc7ba7..d9fcccd96b2 100644 --- a/api/management/v1/json/client/management_service/list_services_responses.go +++ b/api/management/v1/json/client/management_service/list_services_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +26,7 @@ type ListServicesReader struct { } // ReadResponse reads a server response into the received o. -func (o *ListServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ListServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewListServicesOK() @@ -104,11 +105,10 @@ func (o *ListServicesOK) GetPayload() *ListServicesOKBody { } func (o *ListServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListServicesOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -178,11 +178,10 @@ func (o *ListServicesDefault) GetPayload() *ListServicesDefaultBody { } func (o *ListServicesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListServicesDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -194,7 +193,6 @@ ListServicesDefaultBody list services default body swagger:model ListServicesDefaultBody */ type ListServicesDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -231,11 +229,15 @@ func (o *ListServicesDefaultBody) validateDetails(formats strfmt.Registry) error if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -260,9 +262,7 @@ func (o *ListServicesDefaultBody) ContextValidate(ctx context.Context, formats s } func (o *ListServicesDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -270,15 +270,18 @@ func (o *ListServicesDefaultBody) contextValidateDetails(ctx context.Context, fo } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -307,19 +310,17 @@ ListServicesDefaultBodyDetailsItems0 list services default body details items0 swagger:model ListServicesDefaultBodyDetailsItems0 */ type ListServicesDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // list services default body details items0 - ListServicesDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + ListServicesDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *ListServicesDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -340,9 +341,9 @@ func (o *ListServicesDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -357,7 +358,6 @@ func (o *ListServicesDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error // MarshalJSON marshals this object with additional properties into a JSON object func (o ListServicesDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -421,7 +421,6 @@ ListServicesOKBody list services OK body swagger:model ListServicesOKBody */ type ListServicesOKBody struct { - // List of Services. Services []*ListServicesOKBodyServicesItems0 `json:"services"` } @@ -452,11 +451,15 @@ func (o *ListServicesOKBody) validateServices(formats strfmt.Registry) error { if o.Services[i] != nil { if err := o.Services[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("listServicesOk" + "." + "services" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("listServicesOk" + "." + "services" + "." + strconv.Itoa(i)) } + return err } } @@ -481,9 +484,7 @@ func (o *ListServicesOKBody) ContextValidate(ctx context.Context, formats strfmt } func (o *ListServicesOKBody) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Services); i++ { - if o.Services[i] != nil { if swag.IsZero(o.Services[i]) { // not required @@ -491,15 +492,18 @@ func (o *ListServicesOKBody) contextValidateServices(ctx context.Context, format } if err := o.Services[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("listServicesOk" + "." + "services" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("listServicesOk" + "." + "services" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -528,7 +532,6 @@ ListServicesOKBodyServicesItems0 list services OK body services items0 swagger:model ListServicesOKBodyServicesItems0 */ type ListServicesOKBodyServicesItems0 struct { - // Unique service identifier. ServiceID string `json:"service_id,omitempty"` @@ -585,9 +588,6 @@ type ListServicesOKBodyServicesItems0 struct { // List of agents related to this service. Agents []*ListServicesOKBodyServicesItems0AgentsItems0 `json:"agents"` - // The service/database version. - Version string `json:"version,omitempty"` - // Service status. // // - STATUS_UNSPECIFIED: In case we don't support the db vendor yet. @@ -596,6 +596,9 @@ type ListServicesOKBodyServicesItems0 struct { // - STATUS_UNKNOWN: The service's status cannot be known (e.g. there are no metrics yet). // Enum: ["STATUS_UNSPECIFIED","STATUS_UP","STATUS_DOWN","STATUS_UNKNOWN"] Status *string `json:"status,omitempty"` + + // The service/database version. + Version string `json:"version,omitempty"` } // Validate validates this list services OK body services items0 @@ -660,11 +663,15 @@ func (o *ListServicesOKBodyServicesItems0) validateAgents(formats strfmt.Registr if o.Agents[i] != nil { if err := o.Agents[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("agents" + "." + strconv.Itoa(i)) } + return err } } @@ -674,7 +681,7 @@ func (o *ListServicesOKBodyServicesItems0) validateAgents(formats strfmt.Registr return nil } -var listServicesOkBodyServicesItems0TypeStatusPropEnum []interface{} +var listServicesOkBodyServicesItems0TypeStatusPropEnum []any func init() { var res []string @@ -737,9 +744,7 @@ func (o *ListServicesOKBodyServicesItems0) ContextValidate(ctx context.Context, } func (o *ListServicesOKBodyServicesItems0) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Agents); i++ { - if o.Agents[i] != nil { if swag.IsZero(o.Agents[i]) { // not required @@ -747,15 +752,18 @@ func (o *ListServicesOKBodyServicesItems0) contextValidateAgents(ctx context.Con } if err := o.Agents[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("agents" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -784,7 +792,6 @@ ListServicesOKBodyServicesItems0AgentsItems0 list services OK body services item swagger:model ListServicesOKBodyServicesItems0AgentsItems0 */ type ListServicesOKBodyServicesItems0AgentsItems0 struct { - // Unique agent identifier. AgentID string `json:"agent_id,omitempty"` @@ -816,6 +823,12 @@ type ListServicesOKBodyServicesItems0AgentsItems0 struct { // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` + // Log level for exporters + // + // - LOG_LEVEL_UNSPECIFIED: Auto + // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] + LogLevel *string `json:"log_level,omitempty"` + // Limit query length in QAN. MaxQueryLength int32 `json:"max_query_length,omitempty"` @@ -894,15 +907,12 @@ type ListServicesOKBodyServicesItems0AgentsItems0 struct { // True if an exporter agent is exposed on all host addresses. ExposeExporter bool `json:"expose_exporter,omitempty"` + // valkey options + ValkeyOptions any `json:"valkey_options,omitempty"` + // azure options AzureOptions *ListServicesOKBodyServicesItems0AgentsItems0AzureOptions `json:"azure_options,omitempty"` - // Log level for exporters - // - // - LOG_LEVEL_UNSPECIFIED: Auto - // Enum: ["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"] - LogLevel *string `json:"log_level,omitempty"` - // mongo db options MongoDBOptions *ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions `json:"mongo_db_options,omitempty"` @@ -914,9 +924,6 @@ type ListServicesOKBodyServicesItems0AgentsItems0 struct { // rta options RtaOptions *ListServicesOKBodyServicesItems0AgentsItems0RtaOptions `json:"rta_options,omitempty"` - - // valkey options - ValkeyOptions interface{} `json:"valkey_options,omitempty"` } // Validate validates this list services OK body services items0 agents items0 @@ -927,15 +934,15 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) Validate(formats strfmt.R res = append(res, err) } - if err := o.validateUpdatedAt(formats); err != nil { + if err := o.validateLogLevel(formats); err != nil { res = append(res, err) } - if err := o.validateAzureOptions(formats); err != nil { + if err := o.validateUpdatedAt(formats); err != nil { res = append(res, err) } - if err := o.validateLogLevel(formats); err != nil { + if err := o.validateAzureOptions(formats); err != nil { res = append(res, err) } @@ -973,38 +980,7 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateCreatedAt(formats return nil } -func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updated_at", "body", "date-time", o.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateAzureOptions(formats strfmt.Registry) error { - if swag.IsZero(o.AzureOptions) { // not required - return nil - } - - if o.AzureOptions != nil { - if err := o.AzureOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("azure_options") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("azure_options") - } - return err - } - } - - return nil -} - -var listServicesOkBodyServicesItems0AgentsItems0TypeLogLevelPropEnum []interface{} +var listServicesOkBodyServicesItems0AgentsItems0TypeLogLevelPropEnum []any func init() { var res []string @@ -1058,6 +1034,41 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateLogLevel(formats return nil } +func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(o.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updated_at", "body", "date-time", o.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateAzureOptions(formats strfmt.Registry) error { + if swag.IsZero(o.AzureOptions) { // not required + return nil + } + + if o.AzureOptions != nil { + if err := o.AzureOptions.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("azure_options") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("azure_options") + } + + return err + } + } + + return nil +} + func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateMongoDBOptions(formats strfmt.Registry) error { if swag.IsZero(o.MongoDBOptions) { // not required return nil @@ -1065,11 +1076,15 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateMongoDBOptions(fo if o.MongoDBOptions != nil { if err := o.MongoDBOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("mongo_db_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("mongo_db_options") } + return err } } @@ -1084,11 +1099,15 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateMysqlOptions(form if o.MysqlOptions != nil { if err := o.MysqlOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("mysql_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("mysql_options") } + return err } } @@ -1103,11 +1122,15 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) validatePostgresqlOptions if o.PostgresqlOptions != nil { if err := o.PostgresqlOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("postgresql_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("postgresql_options") } + return err } } @@ -1122,11 +1145,15 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateRtaOptions(format if o.RtaOptions != nil { if err := o.RtaOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("rta_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("rta_options") } + return err } } @@ -1165,7 +1192,6 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) ContextValidate(ctx conte } func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateAzureOptions(ctx context.Context, formats strfmt.Registry) error { - if o.AzureOptions != nil { if swag.IsZero(o.AzureOptions) { // not required @@ -1173,11 +1199,15 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateAzureOptio } if err := o.AzureOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("azure_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("azure_options") } + return err } } @@ -1186,7 +1216,6 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateAzureOptio } func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateMongoDBOptions(ctx context.Context, formats strfmt.Registry) error { - if o.MongoDBOptions != nil { if swag.IsZero(o.MongoDBOptions) { // not required @@ -1194,11 +1223,15 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateMongoDBOpt } if err := o.MongoDBOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("mongo_db_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("mongo_db_options") } + return err } } @@ -1207,7 +1240,6 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateMongoDBOpt } func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateMysqlOptions(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlOptions != nil { if swag.IsZero(o.MysqlOptions) { // not required @@ -1215,11 +1247,15 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateMysqlOptio } if err := o.MysqlOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("mysql_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("mysql_options") } + return err } } @@ -1228,7 +1264,6 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateMysqlOptio } func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidatePostgresqlOptions(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresqlOptions != nil { if swag.IsZero(o.PostgresqlOptions) { // not required @@ -1236,11 +1271,15 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidatePostgresql } if err := o.PostgresqlOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("postgresql_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("postgresql_options") } + return err } } @@ -1249,7 +1288,6 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidatePostgresql } func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateRtaOptions(ctx context.Context, formats strfmt.Registry) error { - if o.RtaOptions != nil { if swag.IsZero(o.RtaOptions) { // not required @@ -1257,11 +1295,15 @@ func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateRtaOptions } if err := o.RtaOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("rta_options") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("rta_options") } + return err } } @@ -1292,7 +1334,6 @@ ListServicesOKBodyServicesItems0AgentsItems0AzureOptions list services OK body s swagger:model ListServicesOKBodyServicesItems0AgentsItems0AzureOptions */ type ListServicesOKBodyServicesItems0AgentsItems0AzureOptions struct { - // Azure client ID. ClientID string `json:"client_id,omitempty"` @@ -1342,7 +1383,6 @@ ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions list services OK body swagger:model ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions */ type ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions struct { - // True if TLS certificate is set. IsTLSCertificateKeySet bool `json:"is_tls_certificate_key_set,omitempty"` @@ -1398,7 +1438,6 @@ ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions list services OK body s swagger:model ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions */ type ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions struct { - // True if TLS key is set. IsTLSKeySet bool `json:"is_tls_key_set,omitempty"` @@ -1439,7 +1478,6 @@ ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions list services OK b swagger:model ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions */ type ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions struct { - // True if TLS key is set. IsSslKeySet bool `json:"is_ssl_key_set,omitempty"` @@ -1483,7 +1521,6 @@ ListServicesOKBodyServicesItems0AgentsItems0RtaOptions RTAOptions holds Real-Tim swagger:model ListServicesOKBodyServicesItems0AgentsItems0RtaOptions */ type ListServicesOKBodyServicesItems0AgentsItems0RtaOptions struct { - // Query collect interval (default 2s is set by server). CollectInterval string `json:"collect_interval,omitempty"` } diff --git a/api/management/v1/json/client/management_service/management_service_client.go b/api/management/v1/json/client/management_service/management_service_client.go index 86f82f40fe2..1bd281d0e74 100644 --- a/api/management/v1/json/client/management_service/management_service_client.go +++ b/api/management/v1/json/client/management_service/management_service_client.go @@ -91,7 +91,7 @@ AddAnnotation adds an annotation Adds an annotation. */ func (a *Client) AddAnnotation(params *AddAnnotationParams, opts ...ClientOption) (*AddAnnotationOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewAddAnnotationParams() } @@ -110,17 +110,22 @@ func (a *Client) AddAnnotation(params *AddAnnotationParams, opts ...ClientOption for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*AddAnnotationOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*AddAnnotationDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -130,7 +135,7 @@ AddAzureDatabase adds azure database Adds an Azure Database instance. */ func (a *Client) AddAzureDatabase(params *AddAzureDatabaseParams, opts ...ClientOption) (*AddAzureDatabaseOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewAddAzureDatabaseParams() } @@ -149,17 +154,22 @@ func (a *Client) AddAzureDatabase(params *AddAzureDatabaseParams, opts ...Client for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*AddAzureDatabaseOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*AddAzureDatabaseDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -169,7 +179,7 @@ AddService adds a service Adds a service and starts several agents. */ func (a *Client) AddService(params *AddServiceParams, opts ...ClientOption) (*AddServiceOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewAddServiceParams() } @@ -188,17 +198,22 @@ func (a *Client) AddService(params *AddServiceParams, opts ...ClientOption) (*Ad for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*AddServiceOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*AddServiceDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -208,7 +223,7 @@ CreateNodeInstallToken creates node install token Creates a short-lived Grafana service account token for PMM Client install. */ func (a *Client) CreateNodeInstallToken(params *CreateNodeInstallTokenParams, opts ...ClientOption) (*CreateNodeInstallTokenOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewCreateNodeInstallTokenParams() } @@ -227,17 +242,22 @@ func (a *Client) CreateNodeInstallToken(params *CreateNodeInstallTokenParams, op for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*CreateNodeInstallTokenOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*CreateNodeInstallTokenDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -247,7 +267,7 @@ DiscoverAzureDatabase discovers azure database Discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances. */ func (a *Client) DiscoverAzureDatabase(params *DiscoverAzureDatabaseParams, opts ...ClientOption) (*DiscoverAzureDatabaseOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewDiscoverAzureDatabaseParams() } @@ -266,17 +286,22 @@ func (a *Client) DiscoverAzureDatabase(params *DiscoverAzureDatabaseParams, opts for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*DiscoverAzureDatabaseOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*DiscoverAzureDatabaseDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -286,7 +311,7 @@ DiscoverRDS discovers RDS Discovers RDS instances. */ func (a *Client) DiscoverRDS(params *DiscoverRDSParams, opts ...ClientOption) (*DiscoverRDSOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewDiscoverRDSParams() } @@ -305,17 +330,22 @@ func (a *Client) DiscoverRDS(params *DiscoverRDSParams, opts ...ClientOption) (* for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*DiscoverRDSOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*DiscoverRDSDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -325,7 +355,7 @@ GetNode gets node Gets a single Node by ID. */ func (a *Client) GetNode(params *GetNodeParams, opts ...ClientOption) (*GetNodeOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewGetNodeParams() } @@ -344,17 +374,22 @@ func (a *Client) GetNode(params *GetNodeParams, opts ...ClientOption) (*GetNodeO for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*GetNodeOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*GetNodeDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -364,7 +399,7 @@ ListAgentVersions lists agent versions Lists Agent versions and their update severity. */ func (a *Client) ListAgentVersions(params *ListAgentVersionsParams, opts ...ClientOption) (*ListAgentVersionsOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewListAgentVersionsParams() } @@ -383,17 +418,22 @@ func (a *Client) ListAgentVersions(params *ListAgentVersionsParams, opts ...Clie for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ListAgentVersionsOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*ListAgentVersionsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -403,7 +443,7 @@ ListAgents lists agents Lists Agents with filter. */ func (a *Client) ListAgents(params *ListAgentsParams, opts ...ClientOption) (*ListAgentsOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewListAgentsParams() } @@ -422,17 +462,22 @@ func (a *Client) ListAgents(params *ListAgentsParams, opts ...ClientOption) (*Li for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ListAgentsOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*ListAgentsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -442,7 +487,7 @@ ListNodes lists nodes Lists Nodes with filter. */ func (a *Client) ListNodes(params *ListNodesParams, opts ...ClientOption) (*ListNodesOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewListNodesParams() } @@ -461,17 +506,22 @@ func (a *Client) ListNodes(params *ListNodesParams, opts ...ClientOption) (*List for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ListNodesOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*ListNodesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -481,7 +531,7 @@ ListServices lists services Returns a filtered list of Services. */ func (a *Client) ListServices(params *ListServicesParams, opts ...ClientOption) (*ListServicesOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewListServicesParams() } @@ -500,17 +550,22 @@ func (a *Client) ListServices(params *ListServicesParams, opts ...ClientOption) for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ListServicesOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*ListServicesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -520,7 +575,7 @@ RegisterNode registers a node Registers a new Node and a pmm-agent. */ func (a *Client) RegisterNode(params *RegisterNodeParams, opts ...ClientOption) (*RegisterNodeOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewRegisterNodeParams() } @@ -539,17 +594,22 @@ func (a *Client) RegisterNode(params *RegisterNodeParams, opts ...ClientOption) for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*RegisterNodeOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*RegisterNodeDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -559,7 +619,7 @@ RemoveService removes a service Removes a Service along with its Agents. */ func (a *Client) RemoveService(params *RemoveServiceParams, opts ...ClientOption) (*RemoveServiceOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewRemoveServiceParams() } @@ -578,17 +638,22 @@ func (a *Client) RemoveService(params *RemoveServiceParams, opts ...ClientOption for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*RemoveServiceOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*RemoveServiceDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } @@ -598,7 +663,7 @@ UnregisterNode unregisters a node Unregisters a Node and pmm-agent */ func (a *Client) UnregisterNode(params *UnregisterNodeParams, opts ...ClientOption) (*UnregisterNodeOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewUnregisterNodeParams() } @@ -617,17 +682,22 @@ func (a *Client) UnregisterNode(params *UnregisterNodeParams, opts ...ClientOpti for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*UnregisterNodeOK) if ok { return success, nil } - // unexpected success response + + // unexpected success response. + // + // a default response is provided: fill this and return an error unexpectedSuccess := result.(*UnregisterNodeDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } diff --git a/api/management/v1/json/client/management_service/register_node_parameters.go b/api/management/v1/json/client/management_service/register_node_parameters.go index 5de06b5b324..a614118a70b 100644 --- a/api/management/v1/json/client/management_service/register_node_parameters.go +++ b/api/management/v1/json/client/management_service/register_node_parameters.go @@ -60,7 +60,6 @@ RegisterNodeParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type RegisterNodeParams struct { - // Body. Body RegisterNodeBody @@ -130,7 +129,6 @@ func (o *RegisterNodeParams) SetBody(body RegisterNodeBody) { // WriteToRequest writes these params to a swagger request func (o *RegisterNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/register_node_responses.go b/api/management/v1/json/client/management_service/register_node_responses.go index 5aed0ea3aa0..f4c682e05e9 100644 --- a/api/management/v1/json/client/management_service/register_node_responses.go +++ b/api/management/v1/json/client/management_service/register_node_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -25,7 +26,7 @@ type RegisterNodeReader struct { } // ReadResponse reads a server response into the received o. -func (o *RegisterNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *RegisterNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewRegisterNodeOK() @@ -104,11 +105,10 @@ func (o *RegisterNodeOK) GetPayload() *RegisterNodeOKBody { } func (o *RegisterNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(RegisterNodeOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -178,11 +178,10 @@ func (o *RegisterNodeDefault) GetPayload() *RegisterNodeDefaultBody { } func (o *RegisterNodeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(RegisterNodeDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -194,6 +193,9 @@ RegisterNodeBody register node body swagger:model RegisterNodeBody */ type RegisterNodeBody struct { + // NodeType describes supported Node types. + // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] + NodeType *string `json:"node_type,omitempty"` // A user-defined name unique across all Nodes. NodeName string `json:"node_name,omitempty"` @@ -228,6 +230,13 @@ type RegisterNodeBody struct { // If true, and Node with that name already exist, it will be removed with all dependent Services and Agents. Reregister bool `json:"reregister,omitempty"` + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // + // - METRICS_MODE_UNSPECIFIED: Auto + // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] + MetricsMode *string `json:"metrics_mode,omitempty"` + // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` @@ -239,28 +248,17 @@ type RegisterNodeBody struct { // AWS instance ID. InstanceID string `json:"instance_id,omitempty"` - - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // - // - METRICS_MODE_UNSPECIFIED: Auto - // Enum: ["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"] - MetricsMode *string `json:"metrics_mode,omitempty"` - - // NodeType describes supported Node types. - // Enum: ["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"] - NodeType *string `json:"node_type,omitempty"` } // Validate validates this register node body func (o *RegisterNodeBody) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateNodeType(formats); err != nil { res = append(res, err) } - if err := o.validateNodeType(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -270,99 +268,99 @@ func (o *RegisterNodeBody) Validate(formats strfmt.Registry) error { return nil } -var registerNodeBodyTypeMetricsModePropEnum []interface{} +var registerNodeBodyTypeNodeTypePropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"]`), &res); err != nil { panic(err) } for _, v := range res { - registerNodeBodyTypeMetricsModePropEnum = append(registerNodeBodyTypeMetricsModePropEnum, v) + registerNodeBodyTypeNodeTypePropEnum = append(registerNodeBodyTypeNodeTypePropEnum, v) } } const ( - // RegisterNodeBodyMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - RegisterNodeBodyMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" + // RegisterNodeBodyNodeTypeNODETYPEUNSPECIFIED captures enum value "NODE_TYPE_UNSPECIFIED" + RegisterNodeBodyNodeTypeNODETYPEUNSPECIFIED string = "NODE_TYPE_UNSPECIFIED" - // RegisterNodeBodyMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - RegisterNodeBodyMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" + // RegisterNodeBodyNodeTypeNODETYPEGENERICNODE captures enum value "NODE_TYPE_GENERIC_NODE" + RegisterNodeBodyNodeTypeNODETYPEGENERICNODE string = "NODE_TYPE_GENERIC_NODE" - // RegisterNodeBodyMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - RegisterNodeBodyMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" + // RegisterNodeBodyNodeTypeNODETYPECONTAINERNODE captures enum value "NODE_TYPE_CONTAINER_NODE" + RegisterNodeBodyNodeTypeNODETYPECONTAINERNODE string = "NODE_TYPE_CONTAINER_NODE" + + // RegisterNodeBodyNodeTypeNODETYPEREMOTENODE captures enum value "NODE_TYPE_REMOTE_NODE" + RegisterNodeBodyNodeTypeNODETYPEREMOTENODE string = "NODE_TYPE_REMOTE_NODE" + + // RegisterNodeBodyNodeTypeNODETYPEREMOTERDSNODE captures enum value "NODE_TYPE_REMOTE_RDS_NODE" + RegisterNodeBodyNodeTypeNODETYPEREMOTERDSNODE string = "NODE_TYPE_REMOTE_RDS_NODE" + + // RegisterNodeBodyNodeTypeNODETYPEREMOTEAZUREDATABASENODE captures enum value "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + RegisterNodeBodyNodeTypeNODETYPEREMOTEAZUREDATABASENODE string = "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" ) // prop value enum -func (o *RegisterNodeBody) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, registerNodeBodyTypeMetricsModePropEnum, true); err != nil { +func (o *RegisterNodeBody) validateNodeTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, registerNodeBodyTypeNodeTypePropEnum, true); err != nil { return err } return nil } -func (o *RegisterNodeBody) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required +func (o *RegisterNodeBody) validateNodeType(formats strfmt.Registry) error { + if swag.IsZero(o.NodeType) { // not required return nil } // value enum - if err := o.validateMetricsModeEnum("body"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + if err := o.validateNodeTypeEnum("body"+"."+"node_type", "body", *o.NodeType); err != nil { return err } return nil } -var registerNodeBodyTypeNodeTypePropEnum []interface{} +var registerNodeBodyTypeMetricsModePropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["NODE_TYPE_UNSPECIFIED","NODE_TYPE_GENERIC_NODE","NODE_TYPE_CONTAINER_NODE","NODE_TYPE_REMOTE_NODE","NODE_TYPE_REMOTE_RDS_NODE","NODE_TYPE_REMOTE_AZURE_DATABASE_NODE"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["METRICS_MODE_UNSPECIFIED","METRICS_MODE_PULL","METRICS_MODE_PUSH"]`), &res); err != nil { panic(err) } for _, v := range res { - registerNodeBodyTypeNodeTypePropEnum = append(registerNodeBodyTypeNodeTypePropEnum, v) + registerNodeBodyTypeMetricsModePropEnum = append(registerNodeBodyTypeMetricsModePropEnum, v) } } const ( - // RegisterNodeBodyNodeTypeNODETYPEUNSPECIFIED captures enum value "NODE_TYPE_UNSPECIFIED" - RegisterNodeBodyNodeTypeNODETYPEUNSPECIFIED string = "NODE_TYPE_UNSPECIFIED" - - // RegisterNodeBodyNodeTypeNODETYPEGENERICNODE captures enum value "NODE_TYPE_GENERIC_NODE" - RegisterNodeBodyNodeTypeNODETYPEGENERICNODE string = "NODE_TYPE_GENERIC_NODE" - - // RegisterNodeBodyNodeTypeNODETYPECONTAINERNODE captures enum value "NODE_TYPE_CONTAINER_NODE" - RegisterNodeBodyNodeTypeNODETYPECONTAINERNODE string = "NODE_TYPE_CONTAINER_NODE" - - // RegisterNodeBodyNodeTypeNODETYPEREMOTENODE captures enum value "NODE_TYPE_REMOTE_NODE" - RegisterNodeBodyNodeTypeNODETYPEREMOTENODE string = "NODE_TYPE_REMOTE_NODE" + // RegisterNodeBodyMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" + RegisterNodeBodyMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - // RegisterNodeBodyNodeTypeNODETYPEREMOTERDSNODE captures enum value "NODE_TYPE_REMOTE_RDS_NODE" - RegisterNodeBodyNodeTypeNODETYPEREMOTERDSNODE string = "NODE_TYPE_REMOTE_RDS_NODE" + // RegisterNodeBodyMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" + RegisterNodeBodyMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - // RegisterNodeBodyNodeTypeNODETYPEREMOTEAZUREDATABASENODE captures enum value "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - RegisterNodeBodyNodeTypeNODETYPEREMOTEAZUREDATABASENODE string = "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + // RegisterNodeBodyMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" + RegisterNodeBodyMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" ) // prop value enum -func (o *RegisterNodeBody) validateNodeTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, registerNodeBodyTypeNodeTypePropEnum, true); err != nil { +func (o *RegisterNodeBody) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, registerNodeBodyTypeMetricsModePropEnum, true); err != nil { return err } return nil } -func (o *RegisterNodeBody) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required +func (o *RegisterNodeBody) validateMetricsMode(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsMode) { // not required return nil } // value enum - if err := o.validateNodeTypeEnum("body"+"."+"node_type", "body", *o.NodeType); err != nil { + if err := o.validateMetricsModeEnum("body"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { return err } @@ -397,7 +395,6 @@ RegisterNodeDefaultBody register node default body swagger:model RegisterNodeDefaultBody */ type RegisterNodeDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -434,11 +431,15 @@ func (o *RegisterNodeDefaultBody) validateDetails(formats strfmt.Registry) error if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -463,9 +464,7 @@ func (o *RegisterNodeDefaultBody) ContextValidate(ctx context.Context, formats s } func (o *RegisterNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -473,15 +472,18 @@ func (o *RegisterNodeDefaultBody) contextValidateDetails(ctx context.Context, fo } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -510,19 +512,17 @@ RegisterNodeDefaultBodyDetailsItems0 register node default body details items0 swagger:model RegisterNodeDefaultBodyDetailsItems0 */ type RegisterNodeDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // register node default body details items0 - RegisterNodeDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + RegisterNodeDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *RegisterNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -543,9 +543,9 @@ func (o *RegisterNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -560,7 +560,6 @@ func (o *RegisterNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error // MarshalJSON marshals this object with additional properties into a JSON object func (o RegisterNodeDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -624,7 +623,6 @@ RegisterNodeOKBody register node OK body swagger:model RegisterNodeOKBody */ type RegisterNodeOKBody struct { - // Token represents token for vmagent auth config. Token string `json:"token,omitempty"` @@ -670,11 +668,15 @@ func (o *RegisterNodeOKBody) validateContainerNode(formats strfmt.Registry) erro if o.ContainerNode != nil { if err := o.ContainerNode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("registerNodeOk" + "." + "container_node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("registerNodeOk" + "." + "container_node") } + return err } } @@ -689,11 +691,15 @@ func (o *RegisterNodeOKBody) validateGenericNode(formats strfmt.Registry) error if o.GenericNode != nil { if err := o.GenericNode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("registerNodeOk" + "." + "generic_node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("registerNodeOk" + "." + "generic_node") } + return err } } @@ -708,11 +714,15 @@ func (o *RegisterNodeOKBody) validatePMMAgent(formats strfmt.Registry) error { if o.PMMAgent != nil { if err := o.PMMAgent.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("registerNodeOk" + "." + "pmm_agent") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("registerNodeOk" + "." + "pmm_agent") } + return err } } @@ -743,7 +753,6 @@ func (o *RegisterNodeOKBody) ContextValidate(ctx context.Context, formats strfmt } func (o *RegisterNodeOKBody) contextValidateContainerNode(ctx context.Context, formats strfmt.Registry) error { - if o.ContainerNode != nil { if swag.IsZero(o.ContainerNode) { // not required @@ -751,11 +760,15 @@ func (o *RegisterNodeOKBody) contextValidateContainerNode(ctx context.Context, f } if err := o.ContainerNode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("registerNodeOk" + "." + "container_node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("registerNodeOk" + "." + "container_node") } + return err } } @@ -764,7 +777,6 @@ func (o *RegisterNodeOKBody) contextValidateContainerNode(ctx context.Context, f } func (o *RegisterNodeOKBody) contextValidateGenericNode(ctx context.Context, formats strfmt.Registry) error { - if o.GenericNode != nil { if swag.IsZero(o.GenericNode) { // not required @@ -772,11 +784,15 @@ func (o *RegisterNodeOKBody) contextValidateGenericNode(ctx context.Context, for } if err := o.GenericNode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("registerNodeOk" + "." + "generic_node") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("registerNodeOk" + "." + "generic_node") } + return err } } @@ -785,7 +801,6 @@ func (o *RegisterNodeOKBody) contextValidateGenericNode(ctx context.Context, for } func (o *RegisterNodeOKBody) contextValidatePMMAgent(ctx context.Context, formats strfmt.Registry) error { - if o.PMMAgent != nil { if swag.IsZero(o.PMMAgent) { // not required @@ -793,11 +808,15 @@ func (o *RegisterNodeOKBody) contextValidatePMMAgent(ctx context.Context, format } if err := o.PMMAgent.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("registerNodeOk" + "." + "pmm_agent") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("registerNodeOk" + "." + "pmm_agent") } + return err } } @@ -828,7 +847,6 @@ RegisterNodeOKBodyContainerNode ContainerNode represents a Docker container. swagger:model RegisterNodeOKBodyContainerNode */ type RegisterNodeOKBodyContainerNode struct { - // Unique randomly generated instance identifier. NodeID string `json:"node_id,omitempty"` @@ -896,7 +914,6 @@ RegisterNodeOKBodyGenericNode GenericNode represents a bare metal server or virt swagger:model RegisterNodeOKBodyGenericNode */ type RegisterNodeOKBodyGenericNode struct { - // Unique randomly generated instance identifier. NodeID string `json:"node_id,omitempty"` @@ -961,7 +978,6 @@ RegisterNodeOKBodyPMMAgent PMMAgent runs on Generic or Container Node. swagger:model RegisterNodeOKBodyPMMAgent */ type RegisterNodeOKBodyPMMAgent struct { - // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` diff --git a/api/management/v1/json/client/management_service/remove_service_parameters.go b/api/management/v1/json/client/management_service/remove_service_parameters.go index 7700f224248..16511c1b2e4 100644 --- a/api/management/v1/json/client/management_service/remove_service_parameters.go +++ b/api/management/v1/json/client/management_service/remove_service_parameters.go @@ -60,7 +60,6 @@ RemoveServiceParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type RemoveServiceParams struct { - /* ServiceID. Either a Service ID or a Service Name. @@ -92,9 +91,7 @@ func (o *RemoveServiceParams) WithDefaults() *RemoveServiceParams { // // All values with no default are reset to their zero value. func (o *RemoveServiceParams) SetDefaults() { - var ( - serviceTypeDefault = string("SERVICE_TYPE_UNSPECIFIED") - ) + serviceTypeDefault := string("SERVICE_TYPE_UNSPECIFIED") val := RemoveServiceParams{ ServiceType: &serviceTypeDefault, @@ -163,7 +160,6 @@ func (o *RemoveServiceParams) SetServiceType(serviceType *string) { // WriteToRequest writes these params to a swagger request func (o *RemoveServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } @@ -184,7 +180,6 @@ func (o *RemoveServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } qServiceType := qrServiceType if qServiceType != "" { - if err := r.SetQueryParam("service_type", qServiceType); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/remove_service_responses.go b/api/management/v1/json/client/management_service/remove_service_responses.go index d413afd47f3..b9b54fc46ba 100644 --- a/api/management/v1/json/client/management_service/remove_service_responses.go +++ b/api/management/v1/json/client/management_service/remove_service_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -24,7 +25,7 @@ type RemoveServiceReader struct { } // ReadResponse reads a server response into the received o. -func (o *RemoveServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *RemoveServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewRemoveServiceOK() @@ -55,7 +56,7 @@ RemoveServiceOK describes a response with status code 200, with default header v A successful response. */ type RemoveServiceOK struct { - Payload interface{} + Payload any } // IsSuccess returns true when this remove service Ok response has a 2xx status code @@ -98,14 +99,13 @@ func (o *RemoveServiceOK) String() string { return fmt.Sprintf("[DELETE /v1/management/services/{service_id}][%d] removeServiceOk %s", 200, payload) } -func (o *RemoveServiceOK) GetPayload() interface{} { +func (o *RemoveServiceOK) GetPayload() any { return o.Payload } func (o *RemoveServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -175,11 +175,10 @@ func (o *RemoveServiceDefault) GetPayload() *RemoveServiceDefaultBody { } func (o *RemoveServiceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(RemoveServiceDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -191,7 +190,6 @@ RemoveServiceDefaultBody remove service default body swagger:model RemoveServiceDefaultBody */ type RemoveServiceDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -228,11 +226,15 @@ func (o *RemoveServiceDefaultBody) validateDetails(formats strfmt.Registry) erro if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -257,9 +259,7 @@ func (o *RemoveServiceDefaultBody) ContextValidate(ctx context.Context, formats } func (o *RemoveServiceDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -267,15 +267,18 @@ func (o *RemoveServiceDefaultBody) contextValidateDetails(ctx context.Context, f } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -304,19 +307,17 @@ RemoveServiceDefaultBodyDetailsItems0 remove service default body details items0 swagger:model RemoveServiceDefaultBodyDetailsItems0 */ type RemoveServiceDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // remove service default body details items0 - RemoveServiceDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + RemoveServiceDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *RemoveServiceDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -337,9 +338,9 @@ func (o *RemoveServiceDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -354,7 +355,6 @@ func (o *RemoveServiceDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error // MarshalJSON marshals this object with additional properties into a JSON object func (o RemoveServiceDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } diff --git a/api/management/v1/json/client/management_service/unregister_node_parameters.go b/api/management/v1/json/client/management_service/unregister_node_parameters.go index 21d279574a5..069530e44b2 100644 --- a/api/management/v1/json/client/management_service/unregister_node_parameters.go +++ b/api/management/v1/json/client/management_service/unregister_node_parameters.go @@ -61,7 +61,6 @@ UnregisterNodeParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type UnregisterNodeParams struct { - /* Force. Force delete node, related service account, even if it has more service tokens attached. @@ -151,7 +150,6 @@ func (o *UnregisterNodeParams) SetNodeID(nodeID string) { // WriteToRequest writes these params to a swagger request func (o *UnregisterNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { return err } @@ -167,7 +165,6 @@ func (o *UnregisterNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfm } qForce := swag.FormatBool(qrForce) if qForce != "" { - if err := r.SetQueryParam("force", qForce); err != nil { return err } diff --git a/api/management/v1/json/client/management_service/unregister_node_responses.go b/api/management/v1/json/client/management_service/unregister_node_responses.go index 8204d24e157..a935e26136f 100644 --- a/api/management/v1/json/client/management_service/unregister_node_responses.go +++ b/api/management/v1/json/client/management_service/unregister_node_responses.go @@ -8,6 +8,7 @@ package management_service import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" "strconv" @@ -24,7 +25,7 @@ type UnregisterNodeReader struct { } // ReadResponse reads a server response into the received o. -func (o *UnregisterNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *UnregisterNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewUnregisterNodeOK() @@ -103,11 +104,10 @@ func (o *UnregisterNodeOK) GetPayload() *UnregisterNodeOKBody { } func (o *UnregisterNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UnregisterNodeOKBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -177,11 +177,10 @@ func (o *UnregisterNodeDefault) GetPayload() *UnregisterNodeDefaultBody { } func (o *UnregisterNodeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UnregisterNodeDefaultBody) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -193,7 +192,6 @@ UnregisterNodeDefaultBody unregister node default body swagger:model UnregisterNodeDefaultBody */ type UnregisterNodeDefaultBody struct { - // code Code int32 `json:"code,omitempty"` @@ -230,11 +228,15 @@ func (o *UnregisterNodeDefaultBody) validateDetails(formats strfmt.Registry) err if o.Details[i] != nil { if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("UnregisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("UnregisterNode default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } @@ -259,9 +261,7 @@ func (o *UnregisterNodeDefaultBody) ContextValidate(ctx context.Context, formats } func (o *UnregisterNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { if swag.IsZero(o.Details[i]) { // not required @@ -269,15 +269,18 @@ func (o *UnregisterNodeDefaultBody) contextValidateDetails(ctx context.Context, } if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("UnregisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("UnregisterNode default" + "." + "details" + "." + strconv.Itoa(i)) } + return err } } - } return nil @@ -306,19 +309,17 @@ UnregisterNodeDefaultBodyDetailsItems0 unregister node default body details item swagger:model UnregisterNodeDefaultBodyDetailsItems0 */ type UnregisterNodeDefaultBodyDetailsItems0 struct { - // at type AtType string `json:"@type,omitempty"` // unregister node default body details items0 - UnregisterNodeDefaultBodyDetailsItems0 map[string]interface{} `json:"-"` + UnregisterNodeDefaultBodyDetailsItems0 map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON func (o *UnregisterNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { // stage 1, bind the properties var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -339,9 +340,9 @@ func (o *UnregisterNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) erro delete(stage2, "@type") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -356,7 +357,6 @@ func (o *UnregisterNodeDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) erro // MarshalJSON marshals this object with additional properties into a JSON object func (o UnregisterNodeDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { var stage1 struct { - // at type AtType string `json:"@type,omitempty"` } @@ -420,7 +420,6 @@ UnregisterNodeOKBody unregister node OK body swagger:model UnregisterNodeOKBody */ type UnregisterNodeOKBody struct { - // Warning message if there are more service tokens attached to service account. Warning string `json:"warning,omitempty"` } diff --git a/api/management/v1/json/v1.json b/api/management/v1/json/v1.json index 8b89ddb89c4..0ed18ef1ab6 100644 --- a/api/management/v1/json/v1.json +++ b/api/management/v1/json/v1.json @@ -74,6 +74,37 @@ "type": "boolean", "x-order": 4 }, + "azure_options": { + "type": "object", + "properties": { + "client_id": { + "description": "Azure client ID.", + "type": "string", + "x-order": 0 + }, + "is_client_secret_set": { + "description": "True if Azure client secret is set.", + "type": "boolean", + "x-order": 1 + }, + "resource_group": { + "description": "Azure resource group.", + "type": "string", + "x-order": 2 + }, + "subscription_id": { + "description": "Azure subscription ID.", + "type": "string", + "x-order": 3 + }, + "tenant_id": { + "description": "Azure tenant ID.", + "type": "string", + "x-order": 4 + } + }, + "x-order": 5 + }, "created_at": { "description": "Creation timestamp.", "type": "string", @@ -107,6 +138,21 @@ "format": "int64", "x-order": 10 }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "x-order": 11 + }, "max_query_length": { "description": "Limit query length in QAN.", "type": "integer", @@ -129,6 +175,70 @@ "type": "string", "x-order": 15 }, + "mongo_db_options": { + "type": "object", + "properties": { + "is_tls_certificate_key_set": { + "description": "True if TLS certificate is set.", + "type": "boolean", + "x-order": 0 + }, + "is_tls_certificate_key_file_password_set": { + "description": "True if TLS certificate file password is set.", + "type": "boolean", + "x-order": 1 + }, + "authentication_mechanism": { + "description": "MongoDB auth mechanism.", + "type": "string", + "x-order": 2 + }, + "authentication_database": { + "description": "MongoDB auth database.", + "type": "string", + "x-order": 3 + }, + "stats_collections": { + "description": "MongoDB stats collections.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 4 + }, + "collections_limit": { + "description": "MongoDB collections limit.", + "type": "integer", + "format": "int32", + "x-order": 5 + }, + "enable_all_collectors": { + "description": "True if all collectors are enabled.", + "type": "boolean", + "x-order": 6 + } + }, + "x-order": 16 + }, + "mysql_options": { + "type": "object", + "properties": { + "is_tls_key_set": { + "description": "True if TLS key is set.", + "type": "boolean", + "x-order": 0 + }, + "extra_dsn_params": { + "description": "Extra DSN parameters for MySQL connection.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 1 + } + }, + "x-order": 17 + }, "node_id": { "description": "A unique node identifier.", "type": "string", @@ -144,6 +254,29 @@ "type": "string", "x-order": 20 }, + "postgresql_options": { + "type": "object", + "properties": { + "is_ssl_key_set": { + "description": "True if TLS key is set.", + "type": "boolean", + "x-order": 0 + }, + "auto_discovery_limit": { + "description": "Limit of databases for auto-discovery.", + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "max_exporter_connections": { + "description": "Maximum number of connections from exporter to PostgreSQL instance.", + "type": "integer", + "format": "int32", + "x-order": 2 + } + }, + "x-order": 21 + }, "process_exec_path": { "description": "Path to exec process.", "type": "string", @@ -237,218 +370,92 @@ "type": "boolean", "x-order": 39 }, - "azure_options": { + "valkey_options": { + "type": "object", + "x-order": 40 + }, + "rta_options": { + "description": "RTAOptions holds Real-Time Query Analytics agent options.", "type": "object", "properties": { - "client_id": { - "description": "Azure client ID.", + "collect_interval": { + "description": "Query collect interval (default 2s is set by server).", "type": "string", "x-order": 0 - }, - "is_client_secret_set": { - "description": "True if Azure client secret is set.", - "type": "boolean", - "x-order": 1 - }, - "resource_group": { - "description": "Azure resource group.", - "type": "string", - "x-order": 2 - }, - "subscription_id": { - "description": "Azure subscription ID.", - "type": "string", - "x-order": 3 - }, - "tenant_id": { - "description": "Azure tenant ID.", - "type": "string", - "x-order": 4 } - } + }, + "x-order": 41 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": {} + }, + "x-order": 2 + } + } + } + } + } + } + }, + "/v1/management/agents/versions": { + "get": { + "description": "Lists Agent versions and their update severity.", + "tags": [ + "ManagementService" + ], + "summary": "List Agent Versions", + "operationId": "ListAgentVersions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "agent_versions": { + "description": "List of Agent versions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "agent_id": { + "description": "Agent ID.", + "type": "string", + "x-order": 0 }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "version": { + "description": "Agent version.", "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] - }, - "mongo_db_options": { - "type": "object", - "properties": { - "is_tls_certificate_key_set": { - "description": "True if TLS certificate is set.", - "type": "boolean", - "x-order": 0 - }, - "is_tls_certificate_key_file_password_set": { - "description": "True if TLS certificate file password is set.", - "type": "boolean", - "x-order": 1 - }, - "authentication_mechanism": { - "description": "MongoDB auth mechanism.", - "type": "string", - "x-order": 2 - }, - "authentication_database": { - "description": "MongoDB auth database.", - "type": "string", - "x-order": 3 - }, - "stats_collections": { - "description": "MongoDB stats collections.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 4 - }, - "collections_limit": { - "description": "MongoDB collections limit.", - "type": "integer", - "format": "int32", - "x-order": 5 - }, - "enable_all_collectors": { - "description": "True if all collectors are enabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "mysql_options": { - "type": "object", - "properties": { - "is_tls_key_set": { - "description": "True if TLS key is set.", - "type": "boolean", - "x-order": 0 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "postgresql_options": { - "type": "object", - "properties": { - "is_ssl_key_set": { - "description": "True if TLS key is set.", - "type": "boolean", - "x-order": 0 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "max_exporter_connections": { - "description": "Maximum number of connections from exporter to PostgreSQL instance.", - "type": "integer", - "format": "int32", - "x-order": 2 - } - } - }, - "rta_options": { - "description": "RTAOptions holds Real-Time Query Analytics agent options.", - "type": "object", - "properties": { - "collect_interval": { - "description": "Query collect interval (default 2s is set by server).", - "type": "string", - "x-order": 0 - } - } - }, - "valkey_options": { - "type": "object" - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/agents/versions": { - "get": { - "description": "Lists Agent versions and their update severity.", - "tags": [ - "ManagementService" - ], - "summary": "List Agent Versions", - "operationId": "ListAgentVersions", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "agent_versions": { - "description": "List of Agent versions.", - "type": "array", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Agent ID.", - "type": "string", - "x-order": 0 - }, - "version": { - "description": "Agent version.", - "type": "string", - "x-order": 1 + "x-order": 1 }, "node_name": { "description": "Node name where the agent runs.", @@ -465,7 +472,8 @@ "UPDATE_SEVERITY_UP_TO_DATE", "UPDATE_SEVERITY_REQUIRED", "UPDATE_SEVERITY_CRITICAL" - ] + ], + "x-order": 3 } } }, @@ -708,6 +716,18 @@ "format": "date-time", "x-order": 13 }, + "status": { + "description": "Node status.\n\n - STATUS_UNSPECIFIED: Invalid status.\n - STATUS_UP: The node is up.\n - STATUS_DOWN: The node is down.\n - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet).", + "type": "string", + "default": "STATUS_UNSPECIFIED", + "enum": [ + "STATUS_UNSPECIFIED", + "STATUS_UP", + "STATUS_DOWN", + "STATUS_UNKNOWN" + ], + "x-order": 14 + }, "agents": { "description": "List of agents related to this node.", "type": "array", @@ -773,17 +793,6 @@ "description": "True if this node is a PMM Server node (HA mode).", "type": "boolean", "x-order": 18 - }, - "status": { - "description": "Node status.\n\n - STATUS_UNSPECIFIED: Invalid status.\n - STATUS_UP: The node is up.\n - STATUS_DOWN: The node is down.\n - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet).", - "type": "string", - "default": "STATUS_UNSPECIFIED", - "enum": [ - "STATUS_UNSPECIFIED", - "STATUS_UP", - "STATUS_DOWN", - "STATUS_UNKNOWN" - ] } } }, @@ -840,6 +849,20 @@ "schema": { "type": "object", "properties": { + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ], + "x-order": 0 + }, "node_name": { "description": "A user-defined name unique across all Nodes.", "type": "string", @@ -898,6 +921,17 @@ "type": "boolean", "x-order": 11 }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ], + "x-order": 12 + }, "disable_collectors": { "description": "List of collector names to disable in this exporter.", "type": "array", @@ -920,29 +954,6 @@ "description": "AWS instance ID.", "type": "string", "x-order": 16 - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ] - }, - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ] } } } @@ -954,18 +965,8 @@ "schema": { "type": "object", "properties": { - "token": { - "description": "Token represents token for vmagent auth config.", - "type": "string", - "x-order": 3 - }, - "warning": { - "description": "Warning message.", - "type": "string", - "x-order": 4 - }, - "container_node": { - "description": "ContainerNode represents a Docker container.", + "generic_node": { + "description": "GenericNode represents a bare metal server or virtual machine.", "type": "object", "properties": { "node_id": { @@ -984,34 +985,29 @@ "x-order": 2 }, "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "description": "Linux machine-id.", "type": "string", "x-order": 3 }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "distro": { + "description": "Linux distribution name and version.", "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 + "x-order": 5 }, "region": { "description": "Node region.", "type": "string", - "x-order": 7 + "x-order": 6 }, "az": { "description": "Node availability zone.", "type": "string", - "x-order": 8 + "x-order": 7 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -1019,17 +1015,18 @@ "additionalProperties": { "type": "string" }, - "x-order": 9 + "x-order": 8 }, "is_pmm_server_node": { "description": "True if this node is a PMM Server node (HA mode).", "type": "boolean", - "x-order": 10 + "x-order": 9 } - } + }, + "x-order": 0 }, - "generic_node": { - "description": "GenericNode represents a bare metal server or virtual machine.", + "container_node": { + "description": "ContainerNode represents a Docker container.", "type": "object", "properties": { "node_id": { @@ -1048,29 +1045,34 @@ "x-order": 2 }, "machine_id": { - "description": "Linux machine-id.", + "description": "Linux machine-id of the Generic Node where this Container Node runs.", "type": "string", "x-order": 3 }, - "distro": { - "description": "Linux distribution name and version.", + "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": 5 + "x-order": 6 }, "region": { "description": "Node region.", "type": "string", - "x-order": 6 + "x-order": 7 }, "az": { "description": "Node availability zone.", "type": "string", - "x-order": 7 + "x-order": 8 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -1078,14 +1080,15 @@ "additionalProperties": { "type": "string" }, - "x-order": 8 + "x-order": 9 }, "is_pmm_server_node": { "description": "True if this node is a PMM Server node (HA mode).", "type": "boolean", - "x-order": 9 + "x-order": 10 } - } + }, + "x-order": 1 }, "pmm_agent": { "description": "PMMAgent runs on Generic or Container Node.", @@ -1119,7 +1122,18 @@ "type": "string", "x-order": 4 } - } + }, + "x-order": 2 + }, + "token": { + "description": "Token represents token for vmagent auth config.", + "type": "string", + "x-order": 3 + }, + "warning": { + "description": "Warning message.", + "type": "string", + "x-order": 4 } } } @@ -1259,6 +1273,18 @@ "format": "date-time", "x-order": 13 }, + "status": { + "description": "Node status.\n\n - STATUS_UNSPECIFIED: Invalid status.\n - STATUS_UP: The node is up.\n - STATUS_DOWN: The node is down.\n - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet).", + "type": "string", + "default": "STATUS_UNSPECIFIED", + "enum": [ + "STATUS_UNSPECIFIED", + "STATUS_UP", + "STATUS_DOWN", + "STATUS_UNKNOWN" + ], + "x-order": 14 + }, "agents": { "description": "List of agents related to this node.", "type": "array", @@ -1324,19 +1350,9 @@ "description": "True if this node is a PMM Server node (HA mode).", "type": "boolean", "x-order": 18 - }, - "status": { - "description": "Node status.\n\n - STATUS_UNSPECIFIED: Invalid status.\n - STATUS_UP: The node is up.\n - STATUS_DOWN: The node is down.\n - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet).", - "type": "string", - "default": "STATUS_UNSPECIFIED", - "enum": [ - "STATUS_UNSPECIFIED", - "STATUS_UP", - "STATUS_DOWN", - "STATUS_UNKNOWN" - ] } - } + }, + "x-order": 0 } } } @@ -1706,6 +1722,37 @@ "type": "boolean", "x-order": 4 }, + "azure_options": { + "type": "object", + "properties": { + "client_id": { + "description": "Azure client ID.", + "type": "string", + "x-order": 0 + }, + "is_client_secret_set": { + "description": "True if Azure client secret is set.", + "type": "boolean", + "x-order": 1 + }, + "resource_group": { + "description": "Azure resource group.", + "type": "string", + "x-order": 2 + }, + "subscription_id": { + "description": "Azure subscription ID.", + "type": "string", + "x-order": 3 + }, + "tenant_id": { + "description": "Azure tenant ID.", + "type": "string", + "x-order": 4 + } + }, + "x-order": 5 + }, "created_at": { "description": "Creation timestamp.", "type": "string", @@ -1739,6 +1786,21 @@ "format": "int64", "x-order": 10 }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "x-order": 11 + }, "max_query_length": { "description": "Limit query length in QAN.", "type": "integer", @@ -1761,6 +1823,70 @@ "type": "string", "x-order": 15 }, + "mongo_db_options": { + "type": "object", + "properties": { + "is_tls_certificate_key_set": { + "description": "True if TLS certificate is set.", + "type": "boolean", + "x-order": 0 + }, + "is_tls_certificate_key_file_password_set": { + "description": "True if TLS certificate file password is set.", + "type": "boolean", + "x-order": 1 + }, + "authentication_mechanism": { + "description": "MongoDB auth mechanism.", + "type": "string", + "x-order": 2 + }, + "authentication_database": { + "description": "MongoDB auth database.", + "type": "string", + "x-order": 3 + }, + "stats_collections": { + "description": "MongoDB stats collections.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 4 + }, + "collections_limit": { + "description": "MongoDB collections limit.", + "type": "integer", + "format": "int32", + "x-order": 5 + }, + "enable_all_collectors": { + "description": "True if all collectors are enabled.", + "type": "boolean", + "x-order": 6 + } + }, + "x-order": 16 + }, + "mysql_options": { + "type": "object", + "properties": { + "is_tls_key_set": { + "description": "True if TLS key is set.", + "type": "boolean", + "x-order": 0 + }, + "extra_dsn_params": { + "description": "Extra DSN parameters for MySQL connection.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 1 + } + }, + "x-order": 17 + }, "node_id": { "description": "A unique node identifier.", "type": "string", @@ -1776,6 +1902,29 @@ "type": "string", "x-order": 20 }, + "postgresql_options": { + "type": "object", + "properties": { + "is_ssl_key_set": { + "description": "True if TLS key is set.", + "type": "boolean", + "x-order": 0 + }, + "auto_discovery_limit": { + "description": "Limit of databases for auto-discovery.", + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "max_exporter_connections": { + "description": "Maximum number of connections from exporter to PostgreSQL instance.", + "type": "integer", + "format": "int32", + "x-order": 2 + } + }, + "x-order": 21 + }, "process_exec_path": { "description": "Path to exec process.", "type": "string", @@ -1869,157 +2018,26 @@ "type": "boolean", "x-order": 39 }, - "azure_options": { + "valkey_options": { "type": "object", - "properties": { - "client_id": { - "description": "Azure client ID.", - "type": "string", - "x-order": 0 - }, - "is_client_secret_set": { - "description": "True if Azure client secret is set.", - "type": "boolean", - "x-order": 1 - }, - "resource_group": { - "description": "Azure resource group.", - "type": "string", - "x-order": 2 - }, - "subscription_id": { - "description": "Azure subscription ID.", - "type": "string", - "x-order": 3 - }, - "tenant_id": { - "description": "Azure tenant ID.", - "type": "string", - "x-order": 4 - } - } - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] + "x-order": 40 }, - "mongo_db_options": { + "rta_options": { + "description": "RTAOptions holds Real-Time Query Analytics agent options.", "type": "object", "properties": { - "is_tls_certificate_key_set": { - "description": "True if TLS certificate is set.", - "type": "boolean", - "x-order": 0 - }, - "is_tls_certificate_key_file_password_set": { - "description": "True if TLS certificate file password is set.", - "type": "boolean", - "x-order": 1 - }, - "authentication_mechanism": { - "description": "MongoDB auth mechanism.", - "type": "string", - "x-order": 2 - }, - "authentication_database": { - "description": "MongoDB auth database.", - "type": "string", - "x-order": 3 - }, - "stats_collections": { - "description": "MongoDB stats collections.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 4 - }, - "collections_limit": { - "description": "MongoDB collections limit.", - "type": "integer", - "format": "int32", - "x-order": 5 - }, - "enable_all_collectors": { - "description": "True if all collectors are enabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "mysql_options": { - "type": "object", - "properties": { - "is_tls_key_set": { - "description": "True if TLS key is set.", - "type": "boolean", - "x-order": 0 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "postgresql_options": { - "type": "object", - "properties": { - "is_ssl_key_set": { - "description": "True if TLS key is set.", - "type": "boolean", - "x-order": 0 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "max_exporter_connections": { - "description": "Maximum number of connections from exporter to PostgreSQL instance.", - "type": "integer", - "format": "int32", - "x-order": 2 - } - } - }, - "rta_options": { - "description": "RTAOptions holds Real-Time Query Analytics agent options.", - "type": "object", - "properties": { - "collect_interval": { - "description": "Query collect interval (default 2s is set by server).", + "collect_interval": { + "description": "Query collect interval (default 2s is set by server).", "type": "string", "x-order": 0 } - } - }, - "valkey_options": { - "type": "object" + }, + "x-order": 41 } } }, "x-order": 16 }, - "version": { - "description": "The service/database version.", - "type": "string", - "x-order": 18 - }, "status": { "description": "Service status.\n\n - STATUS_UNSPECIFIED: In case we don't support the db vendor yet.\n - STATUS_UP: The service is up.\n - STATUS_DOWN: The service is down.\n - STATUS_UNKNOWN: The service's status cannot be known (e.g. there are no metrics yet).", "type": "string", @@ -2029,7 +2047,13 @@ "STATUS_UP", "STATUS_DOWN", "STATUS_UNKNOWN" - ] + ], + "x-order": 17 + }, + "version": { + "description": "The service/database version.", + "type": "string", + "x-order": 18 } } }, @@ -2086,102 +2110,37 @@ "schema": { "type": "object", "properties": { - "external": { + "mysql": { "type": "object", "properties": { - "runs_on_node_id": { - "description": "Node identifier on which an external exporter is been running.\nruns_on_node_id should always be passed with node_id.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "node_id": { + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", "type": "string", "x-order": 0 }, "node_name": { - "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", "type": "string", "x-order": 1 }, - "address": { - "description": "Node and Exporter access address (DNS name or IP).\naddress should always be passed with add_node.", - "type": "string", - "x-order": 3 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 4 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 5 - }, - "password": { - "description": "HTTP basic auth password for collecting metrics.", - "type": "string", - "x-order": 6 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 7 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 8 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 9 - }, - "node_id": { - "description": "Node identifier on which an external service is been running.\nnode_id should always be passed with runs_on_node_id.", - "type": "string", - "x-order": 10 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 11 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 12 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 13 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 - }, - "group": { - "description": "Group name of external service.", - "type": "string", - "x-order": 15 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 17 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 18 - }, "add_node": { "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ], + "x-order": 0 + }, "node_name": { "description": "Unique across all Nodes user-defined name.", "type": "string", @@ -2229,97 +2188,70 @@ "type": "string" }, "x-order": 9 - }, - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ] } - } - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ] - } - } - }, - "haproxy": { - "type": "object", - "properties": { - "node_id": { - "description": "Node identifier on which an external exporter is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 1 + }, + "x-order": 2 }, - "address": { - "description": "Node and Exporter access address (DNS name or IP).\naddress always should be passed with add_node.", + "service_name": { + "description": "Unique across all Services user-defined name. Required.", "type": "string", "x-order": 3 }, - "service_name": { - "description": "Unique across all Services user-defined name. Required.", + "address": { + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", "type": "string", "x-order": 4 }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", + "port": { + "description": "Service Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", "x-order": 5 }, - "password": { - "description": "HTTP basic auth password for collecting metrics.", + "socket": { + "description": "Service Access socket.\nAddress (and port) or socket is required.", "type": "string", "x-order": 6 }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", + "pmm_agent_id": { + "description": "The \"pmm-agent\" identifier which should run agents. Required.", "type": "string", "x-order": 7 }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 8 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 9 - }, "environment": { "description": "Environment name.", "type": "string", - "x-order": 10 + "x-order": 8 }, "cluster": { "description": "Cluster name.", "type": "string", - "x-order": 11 + "x-order": 9 }, "replication_set": { "description": "Replication set name.", "type": "string", - "x-order": 12 + "x-order": 10 + }, + "username": { + "description": "MySQL username for scraping metrics.", + "type": "string", + "x-order": 11 + }, + "password": { + "description": "MySQL password for scraping metrics.", + "type": "string", + "x-order": 12 + }, + "qan_mysql_perfschema": { + "description": "If true, adds qan-mysql-perfschema-agent for provided service.", + "type": "boolean", + "x-order": 13 + }, + "qan_mysql_slowlog": { + "description": "If true, adds qan-mysql-slowlog-agent for provided service.", + "type": "boolean", + "x-order": 14 }, "custom_labels": { "description": "Custom user-assigned labels for Service.", @@ -2327,22 +2259,152 @@ "additionalProperties": { "type": "string" }, - "x-order": 13 + "x-order": 15 }, "skip_connection_check": { "description": "Skip connection check.", "type": "boolean", - "x-order": 15 + "x-order": 16 + }, + "disable_comments_parsing": { + "description": "Disable parsing comments from queries and showing them in QAN.", + "type": "boolean", + "x-order": 17 + }, + "max_query_length": { + "description": "Limit query length in QAN (default: server-defined; -1: no limit).", + "type": "integer", + "format": "int32", + "x-order": 18 + }, + "disable_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "x-order": 19 + }, + "max_slowlog_file_size": { + "description": "If qan-mysql-slowlog-agent is added, slowlog file is rotated at this size if \u003e 0.\nIf zero, server's default value is used.\nUse negative value to disable rotation.", + "type": "string", + "format": "int64", + "x-order": 20 + }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 21 }, "tls_skip_verify": { "description": "Skip TLS certificate and hostname validation.", "type": "boolean", - "x-order": 16 + "x-order": 22 + }, + "tls_ca": { + "description": "Certificate Authority certificate chain.", + "type": "string", + "x-order": 23 + }, + "tls_cert": { + "description": "Client certificate.", + "type": "string", + "x-order": 24 + }, + "tls_key": { + "description": "Password for decrypting tls_cert.", + "type": "string", + "x-order": 25 + }, + "tablestats_group_table_limit": { + "description": "Tablestats group collectors will be disabled if there are more than that number of tables.\nIf zero, server's default value is used.\nUse negative value to disable them.", + "type": "integer", + "format": "int32", + "x-order": 26 + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ], + "x-order": 27 + }, + "disable_collectors": { + "description": "List of collector names to disable in this exporter.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 28 + }, + "agent_password": { + "description": "Custom password for exporter endpoint /metrics.", + "type": "string", + "x-order": 29 + }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "x-order": 30 + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 31 + }, + "extra_dsn_params": { + "description": "extra DSN parameters to be used for connecting to MySQL.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 32 + } + }, + "x-order": 0 + }, + "mongodb": { + "type": "object", + "properties": { + "node_id": { + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 }, "add_node": { "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ], + "x-order": 0 + }, "node_name": { "description": "Unique across all Nodes user-defined name.", "type": "string", @@ -2390,46 +2452,9 @@ "type": "string" }, "x-order": 9 - }, - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ] } - } - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ] - } - } - }, - "mongodb": { - "type": "object", - "properties": { - "node_id": { - "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 1 + }, + "x-order": 2 }, "service_name": { "description": "Unique across all Services user-defined name. Required.", @@ -2536,6 +2561,17 @@ "format": "int32", "x-order": 22 }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ], + "x-order": 23 + }, "disable_collectors": { "description": "List of collector names to disable in this exporter.", "type": "array", @@ -2578,6 +2614,21 @@ "title": "Enable all collectors", "x-order": 30 }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "x-order": 31 + }, "expose_exporter": { "type": "boolean", "title": "Optionally expose the exporter process on all public interfaces", @@ -2595,11 +2646,41 @@ "description": "If true, adds Real-Time Analytics agent for the provided service.", "type": "boolean", "x-order": 34 + } + }, + "x-order": 1 + }, + "postgresql": { + "type": "object", + "properties": { + "node_id": { + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 }, "add_node": { "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ], + "x-order": 0 + }, "node_name": { "description": "Unique across all Nodes user-defined name.", "type": "string", @@ -2647,60 +2728,9 @@ "type": "string" }, "x-order": 9 - }, - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ] } - } - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ] - } - } - }, - "mysql": { - "type": "object", - "properties": { - "node_id": { - "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 1 + }, + "x-order": 2 }, "service_name": { "description": "Unique across all Services user-defined name. Required.", @@ -2718,84 +2748,83 @@ "format": "int64", "x-order": 5 }, + "database": { + "description": "Database name.", + "type": "string", + "x-order": 6 + }, "socket": { "description": "Service Access socket.\nAddress (and port) or socket is required.", "type": "string", - "x-order": 6 + "x-order": 7 }, "pmm_agent_id": { "description": "The \"pmm-agent\" identifier which should run agents. Required.", "type": "string", - "x-order": 7 + "x-order": 8 }, "environment": { "description": "Environment name.", "type": "string", - "x-order": 8 + "x-order": 9 }, "cluster": { "description": "Cluster name.", "type": "string", - "x-order": 9 + "x-order": 10 }, "replication_set": { "description": "Replication set name.", "type": "string", - "x-order": 10 + "x-order": 11 }, "username": { - "description": "MySQL username for scraping metrics.", + "description": "PostgreSQL username for scraping metrics.", "type": "string", - "x-order": 11 + "x-order": 12 }, "password": { - "description": "MySQL password for scraping metrics.", + "description": "PostgreSQL password for scraping metrics.", "type": "string", - "x-order": 12 - }, - "qan_mysql_perfschema": { - "description": "If true, adds qan-mysql-perfschema-agent for provided service.", - "type": "boolean", "x-order": 13 }, - "qan_mysql_slowlog": { - "description": "If true, adds qan-mysql-slowlog-agent for provided service.", + "qan_postgresql_pgstatements_agent": { + "description": "If true, adds qan-postgresql-pgstatements-agent for provided service.", "type": "boolean", "x-order": 14 }, + "qan_postgresql_pgstatmonitor_agent": { + "description": "If true, adds qan-postgresql-pgstatmonitor-agent for provided service.", + "type": "boolean", + "x-order": 15 + }, + "max_query_length": { + "description": "Limit query length in QAN (default: server-defined; -1: no limit).", + "type": "integer", + "format": "int32", + "x-order": 16 + }, + "disable_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "x-order": 17 + }, "custom_labels": { "description": "Custom user-assigned labels for Service.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 15 + "x-order": 18 }, "skip_connection_check": { "description": "Skip connection check.", "type": "boolean", - "x-order": 16 + "x-order": 19 }, "disable_comments_parsing": { "description": "Disable parsing comments from queries and showing them in QAN.", "type": "boolean", - "x-order": 17 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 18 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 19 - }, - "max_slowlog_file_size": { - "description": "If qan-mysql-slowlog-agent is added, slowlog file is rotated at this size if \u003e 0.\nIf zero, server's default value is used.\nUse negative value to disable rotation.", - "type": "string", - "format": "int64", "x-order": 20 }, "tls": { @@ -2804,61 +2833,115 @@ "x-order": 21 }, "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", + "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", "type": "boolean", "x-order": 22 }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ], "x-order": 23 }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", + "disable_collectors": { + "description": "List of collector names to disable in this exporter.", + "type": "array", + "items": { + "type": "string" + }, "x-order": 24 }, - "tls_key": { - "description": "Password for decrypting tls_cert.", + "tls_ca": { + "description": "TLS CA certificate.", "type": "string", "x-order": 25 }, - "tablestats_group_table_limit": { - "description": "Tablestats group collectors will be disabled if there are more than that number of tables.\nIf zero, server's default value is used.\nUse negative value to disable them.", - "type": "integer", - "format": "int32", + "tls_cert": { + "description": "TLS Certifcate.", + "type": "string", "x-order": 26 }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 28 + "tls_key": { + "description": "TLS Certificate Key.", + "type": "string", + "x-order": 27 }, "agent_password": { "description": "Custom password for exporter endpoint /metrics.", "type": "string", + "x-order": 28 + }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], "x-order": 29 }, + "auto_discovery_limit": { + "description": "Limit for auto discovery.", + "type": "integer", + "format": "int32", + "x-order": 30 + }, "expose_exporter": { "type": "boolean", "title": "Optionally expose the exporter process on all public interfaces", "x-order": 31 }, - "extra_dsn_params": { - "description": "extra DSN parameters to be used for connecting to MySQL.", - "type": "object", - "additionalProperties": { - "type": "string" - }, + "max_exporter_connections": { + "description": "Maximum number of connections that exporter can open to the database instance.", + "type": "integer", + "format": "int32", "x-order": 32 + } + }, + "x-order": 2 + }, + "proxysql": { + "type": "object", + "properties": { + "node_id": { + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 }, "add_node": { "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ], + "x-order": 0 + }, "node_name": { "description": "Unique across all Nodes user-defined name.", "type": "string", @@ -2906,70 +2989,19 @@ "type": "string" }, "x-order": 9 - }, - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ] } - } + }, + "x-order": 2 }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "service_name": { + "description": "Unique across all Services user-defined name. Required.", "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] + "x-order": 3 }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ] - } - } - }, - "postgresql": { - "type": "object", - "properties": { - "node_id": { - "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "address": { + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 + "x-order": 4 }, "port": { "description": "Service Access port.\nPort is required when the address present.", @@ -2977,66 +3009,40 @@ "format": "int64", "x-order": 5 }, - "database": { - "description": "Database name.", - "type": "string", - "x-order": 6 - }, "socket": { "description": "Service Access socket.\nAddress (and port) or socket is required.", "type": "string", - "x-order": 7 + "x-order": 6 }, "pmm_agent_id": { "description": "The \"pmm-agent\" identifier which should run agents. Required.", "type": "string", - "x-order": 8 + "x-order": 7 }, "environment": { "description": "Environment name.", "type": "string", - "x-order": 9 + "x-order": 8 }, "cluster": { "description": "Cluster name.", "type": "string", - "x-order": 10 + "x-order": 9 }, "replication_set": { "description": "Replication set name.", "type": "string", - "x-order": 11 + "x-order": 10 }, "username": { - "description": "PostgreSQL username for scraping metrics.", + "description": "ProxySQL username for scraping metrics.", "type": "string", - "x-order": 12 + "x-order": 11 }, "password": { - "description": "PostgreSQL password for scraping metrics.", + "description": "ProxySQL password for scraping metrics.", "type": "string", - "x-order": 13 - }, - "qan_postgresql_pgstatements_agent": { - "description": "If true, adds qan-postgresql-pgstatements-agent for provided service.", - "type": "boolean", - "x-order": 14 - }, - "qan_postgresql_pgstatmonitor_agent": { - "description": "If true, adds qan-postgresql-pgstatmonitor-agent for provided service.", - "type": "boolean", - "x-order": 15 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 16 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 17 + "x-order": 12 }, "custom_labels": { "description": "Custom user-assigned labels for Service.", @@ -3044,27 +3050,33 @@ "additionalProperties": { "type": "string" }, - "x-order": 18 + "x-order": 13 }, "skip_connection_check": { "description": "Skip connection check.", "type": "boolean", - "x-order": 19 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 20 + "x-order": 14 }, "tls": { "description": "Use TLS for database connections.", "type": "boolean", - "x-order": 21 + "x-order": 15 }, "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", + "description": "Skip TLS certificate and hostname validation.", "type": "boolean", - "x-order": 22 + "x-order": 16 + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ], + "x-order": 17 }, "disable_collectors": { "description": "List of collector names to disable in this exporter.", @@ -3072,49 +3084,67 @@ "items": { "type": "string" }, - "x-order": 24 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 25 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 26 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 27 + "x-order": 18 }, "agent_password": { "description": "Custom password for exporter endpoint /metrics.", "type": "string", - "x-order": 28 + "x-order": 19 }, - "auto_discovery_limit": { - "description": "Limit for auto discovery.", - "type": "integer", - "format": "int32", - "x-order": 30 + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "x-order": 20 }, "expose_exporter": { "type": "boolean", "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 31 + "x-order": 21 + } + }, + "x-order": 3 + }, + "haproxy": { + "type": "object", + "properties": { + "node_id": { + "description": "Node identifier on which an external exporter is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 0 }, - "max_exporter_connections": { - "description": "Maximum number of connections that exporter can open to the database instance.", - "type": "integer", - "format": "int32", - "x-order": 32 + "node_name": { + "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 }, "add_node": { "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ], + "x-order": 0 + }, "node_name": { "description": "Unique across all Nodes user-defined name.", "type": "string", @@ -3162,109 +3192,58 @@ "type": "string" }, "x-order": 9 - }, - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ] } - } - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ] - } - } - }, - "proxysql": { - "type": "object", - "properties": { - "node_id": { - "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", - "type": "string", - "x-order": 0 + }, + "x-order": 2 }, - "node_name": { - "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "address": { + "description": "Node and Exporter access address (DNS name or IP).\naddress always should be passed with add_node.", "type": "string", - "x-order": 1 + "x-order": 3 }, "service_name": { "description": "Unique across all Services user-defined name. Required.", "type": "string", - "x-order": 3 - }, - "address": { - "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", "x-order": 4 }, - "port": { - "description": "Service Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", + "username": { + "description": "HTTP basic auth username for collecting metrics.", + "type": "string", "x-order": 5 }, - "socket": { - "description": "Service Access socket.\nAddress (and port) or socket is required.", + "password": { + "description": "HTTP basic auth password for collecting metrics.", "type": "string", "x-order": 6 }, - "pmm_agent_id": { - "description": "The \"pmm-agent\" identifier which should run agents. Required.", + "scheme": { + "description": "Scheme to generate URI to exporter metrics endpoints.", "type": "string", "x-order": 7 }, - "environment": { - "description": "Environment name.", + "metrics_path": { + "description": "Path under which metrics are exposed, used to generate URI.", "type": "string", "x-order": 8 }, - "cluster": { - "description": "Cluster name.", - "type": "string", + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", "x-order": 9 }, - "replication_set": { - "description": "Replication set name.", + "environment": { + "description": "Environment name.", "type": "string", "x-order": 10 }, - "username": { - "description": "ProxySQL username for scraping metrics.", + "cluster": { + "description": "Cluster name.", "type": "string", "x-order": 11 }, - "password": { - "description": "ProxySQL password for scraping metrics.", + "replication_set": { + "description": "Replication set name.", "type": "string", "x-order": 12 }, @@ -3276,13 +3255,19 @@ }, "x-order": 13 }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 14 - }, - "tls": { - "description": "Use TLS for database connections.", + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ], + "x-order": 14 + }, + "skip_connection_check": { + "description": "Skip connection check.", "type": "boolean", "x-order": 15 }, @@ -3290,29 +3275,41 @@ "description": "Skip TLS certificate and hostname validation.", "type": "boolean", "x-order": 16 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 18 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", + } + }, + "x-order": 4 + }, + "external": { + "type": "object", + "properties": { + "runs_on_node_id": { + "description": "Node identifier on which an external exporter is been running.\nruns_on_node_id should always be passed with node_id.\nExactly one of these parameters should be present: node_id, node_name, add_node.", "type": "string", - "x-order": 19 + "x-order": 0 }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 21 + "node_name": { + "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 }, "add_node": { "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ], + "x-order": 0 + }, "node_name": { "description": "Unique across all Nodes user-defined name.", "type": "string", @@ -3360,35 +3357,78 @@ "type": "string" }, "x-order": 9 - }, - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ] } - } + }, + "x-order": 2 }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "address": { + "description": "Node and Exporter access address (DNS name or IP).\naddress should always be passed with add_node.", "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] + "x-order": 3 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 4 + }, + "username": { + "description": "HTTP basic auth username for collecting metrics.", + "type": "string", + "x-order": 5 + }, + "password": { + "description": "HTTP basic auth password for collecting metrics.", + "type": "string", + "x-order": 6 + }, + "scheme": { + "description": "Scheme to generate URI to exporter metrics endpoints.", + "type": "string", + "x-order": 7 + }, + "metrics_path": { + "description": "Path under which metrics are exposed, used to generate URI.", + "type": "string", + "x-order": 8 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 9 + }, + "node_id": { + "description": "Node identifier on which an external service is been running.\nnode_id should always be passed with runs_on_node_id.", + "type": "string", + "x-order": 10 + }, + "environment": { + "description": "Environment name.", + "type": "string", + "x-order": 11 + }, + "cluster": { + "description": "Cluster name.", + "type": "string", + "x-order": 12 + }, + "replication_set": { + "description": "Replication set name.", + "type": "string", + "x-order": 13 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Service.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 14 + }, + "group": { + "description": "Group name of external service.", + "type": "string", + "x-order": 15 }, "metrics_mode": { "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", @@ -3398,9 +3438,21 @@ "METRICS_MODE_UNSPECIFIED", "METRICS_MODE_PULL", "METRICS_MODE_PUSH" - ] + ], + "x-order": 16 + }, + "skip_connection_check": { + "description": "Skip connection check.", + "type": "boolean", + "x-order": 17 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 18 } - } + }, + "x-order": 5 }, "rds": { "type": "object", @@ -3436,6 +3488,17 @@ "format": "int64", "x-order": 5 }, + "engine": { + "description": "DiscoverRDSEngine describes supported RDS instance engines.", + "type": "string", + "default": "DISCOVER_RDS_ENGINE_UNSPECIFIED", + "enum": [ + "DISCOVER_RDS_ENGINE_UNSPECIFIED", + "DISCOVER_RDS_ENGINE_MYSQL", + "DISCOVER_RDS_ENGINE_POSTGRESQL" + ], + "x-order": 6 + }, "pmm_agent_id": { "description": "PMM Agent ID.", "type": "string", @@ -3540,6 +3603,17 @@ "type": "boolean", "x-order": 26 }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ], + "x-order": 27 + }, "qan_postgresql_pgstatements": { "type": "boolean", "title": "If true, add qan-pgstatements", @@ -3571,28 +3645,9 @@ "type": "integer", "format": "int32", "x-order": 33 - }, - "engine": { - "description": "DiscoverRDSEngine describes supported RDS instance engines.", - "type": "string", - "default": "DISCOVER_RDS_ENGINE_UNSPECIFIED", - "enum": [ - "DISCOVER_RDS_ENGINE_UNSPECIFIED", - "DISCOVER_RDS_ENGINE_MYSQL", - "DISCOVER_RDS_ENGINE_POSTGRESQL" - ] - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", - "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ] } - } + }, + "x-order": 6 }, "valkey": { "type": "object", @@ -3607,109 +3662,24 @@ "type": "string", "x-order": 1 }, - "service_name": { - "description": "User-defined name, it is required and should be unique across all services.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "port": { - "description": "Service access port.\nPort is required when the address is present.", - "type": "integer", - "format": "int64", - "x-order": 5 - }, - "socket": { - "description": "Service access socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 6 - }, - "pmm_agent_id": { - "description": "The \"pmm-agent\" identifier which should run agents. Required.", - "type": "string", - "x-order": 7 - }, - "username": { - "description": "Valkey username for scraping metrics.", - "type": "string", - "x-order": 8 - }, - "password": { - "description": "Valkey password for scraping metrics.", - "type": "string", - "x-order": 9 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 10 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 11 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 12 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 13 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 14 - }, - "tls": { - "description": "Use TLS for connection.", - "type": "boolean", - "x-order": 15 - }, - "tls_skip_verify": { - "description": "Skip TLS verification.", - "type": "boolean", - "x-order": 16 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 19 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 20 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 21 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 22 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 23 - }, "add_node": { "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_UNSPECIFIED", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_GENERIC_NODE", + "NODE_TYPE_CONTAINER_NODE", + "NODE_TYPE_REMOTE_NODE", + "NODE_TYPE_REMOTE_RDS_NODE", + "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" + ], + "x-order": 0 + }, "node_name": { "description": "Unique across all Nodes user-defined name.", "type": "string", @@ -3757,21 +3727,94 @@ "type": "string" }, "x-order": 9 - }, - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ] } - } + }, + "x-order": 2 + }, + "service_name": { + "description": "User-defined name, it is required and should be unique across all services.", + "type": "string", + "x-order": 3 + }, + "address": { + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 4 + }, + "port": { + "description": "Service access port.\nPort is required when the address is present.", + "type": "integer", + "format": "int64", + "x-order": 5 + }, + "socket": { + "description": "Service access socket.\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 6 + }, + "pmm_agent_id": { + "description": "The \"pmm-agent\" identifier which should run agents. Required.", + "type": "string", + "x-order": 7 + }, + "username": { + "description": "Valkey username for scraping metrics.", + "type": "string", + "x-order": 8 + }, + "password": { + "description": "Valkey password for scraping metrics.", + "type": "string", + "x-order": 9 + }, + "environment": { + "description": "Environment name.", + "type": "string", + "x-order": 10 + }, + "cluster": { + "description": "Cluster name.", + "type": "string", + "x-order": 11 + }, + "replication_set": { + "description": "Replication set name.", + "type": "string", + "x-order": 12 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Service.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 13 + }, + "skip_connection_check": { + "description": "Skip connection check.", + "type": "boolean", + "x-order": 14 + }, + "tls": { + "description": "Use TLS for connection.", + "type": "boolean", + "x-order": 15 + }, + "tls_skip_verify": { + "description": "Skip TLS verification.", + "type": "boolean", + "x-order": 16 + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "type": "string", + "default": "METRICS_MODE_UNSPECIFIED", + "enum": [ + "METRICS_MODE_UNSPECIFIED", + "METRICS_MODE_PULL", + "METRICS_MODE_PUSH" + ], + "x-order": 17 }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", @@ -3785,19 +3828,36 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ] + ], + "x-order": 18 }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto", + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 19 + }, + "tls_ca": { + "description": "TLS CA certificate.", "type": "string", - "default": "METRICS_MODE_UNSPECIFIED", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ] + "x-order": 20 + }, + "tls_cert": { + "description": "TLS Certifcate.", + "type": "string", + "x-order": 21 + }, + "tls_key": { + "description": "TLS Certificate Key.", + "type": "string", + "x-order": 22 + }, + "agent_password": { + "description": "Custom password for exporter endpoint /metrics.", + "type": "string", + "x-order": 23 } - } + }, + "x-order": 7 } } } @@ -3809,77 +3869,222 @@ "schema": { "type": "object", "properties": { - "external": { + "mysql": { "type": "object", "properties": { - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", + "service": { + "description": "MySQLService represents a generic MySQL instance.", "type": "object", "properties": { - "agent_id": { + "service_id": { "description": "Unique randomly generated instance identifier.", "type": "string", "x-order": 0 }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", + "service_name": { + "description": "Unique across all Services user-defined name.", "type": "string", "x-order": 1 }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", + "node_id": { + "description": "Node identifier where this instance runs.", + "type": "string", "x-order": 2 }, - "service_id": { - "description": "Service identifier.", + "address": { + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", "type": "string", "x-order": 3 }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", + "port": { + "description": "Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", "x-order": 4 }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", + "socket": { + "description": "Access unix socket.\nAddress (and port) or socket is required.", "type": "string", "x-order": 5 }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", + "environment": { + "description": "Environment name.", "type": "string", "x-order": 6 }, + "cluster": { + "description": "Cluster name.", + "type": "string", + "x-order": 7 + }, + "replication_set": { + "description": "Replication set name.", + "type": "string", + "x-order": 8 + }, "custom_labels": { "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 7 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", "x-order": 9 }, - "process_exec_path": { - "description": "Path to exec process.", + "version": { + "description": "MySQL version.", "type": "string", "x-order": 10 }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname verification.", - "type": "boolean", + "extra_dsn_params": { + "description": "Extra parameters to be added to the DSN.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + } + }, + "x-order": 0 + }, + "mysqld_exporter": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "type": "object", + "properties": { + "agent_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "service_id": { + "description": "Service identifier.", + "type": "string", + "x-order": 3 + }, + "username": { + "description": "MySQL username for scraping metrics.", + "type": "string", + "x-order": 4 + }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 5 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 6 + }, + "tls_ca": { + "description": "Certificate Authority certificate chain.", + "type": "string", + "x-order": 7 + }, + "tls_cert": { + "description": "Client certificate.", + "type": "string", + "x-order": 8 + }, + "tls_key": { + "description": "Password for decrypting tls_cert.", + "type": "string", + "x-order": 9 + }, + "tablestats_group_table_limit": { + "description": "Tablestats group collectors are disabled if there are more than that number of tables.\n0 means tablestats group collectors are always enabled (no limit).\nNegative value means tablestats group collectors are always disabled.", + "type": "integer", + "format": "int32", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + }, + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", "x-order": 12 }, + "disabled_collectors": { + "description": "List of disabled collector names.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 13 + }, + "table_count": { + "description": "Actual table count at the moment of adding.", + "type": "integer", + "format": "int32", + "x-order": 14 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ], + "x-order": 15 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 16 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 17 + }, + "process_exec_path": { + "description": "Path to exec process.", + "type": "string", + "x-order": 18 + }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "x-order": 19 + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 20 + }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", "type": "object", @@ -3899,92 +4104,147 @@ "type": "string", "x-order": 2 } - } + }, + "x-order": 21 }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ] + "extra_dsn_params": { + "description": "Extra DSN parameters for MySQL connection.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 22 } - } + }, + "x-order": 1 }, - "service": { - "description": "ExternalService represents a generic External service instance.", + "qan_mysql_perfschema": { + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", "type": "object", "properties": { - "service_id": { + "agent_id": { "description": "Unique randomly generated instance identifier.", "type": "string", "x-order": 0 }, - "service_name": { - "description": "Unique across all Services user-defined name.", + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", "type": "string", "x-order": 1 }, - "node_id": { - "description": "Node identifier where this service instance runs.", - "type": "string", + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", "x-order": 2 }, - "environment": { - "description": "Environment name.", + "service_id": { + "description": "Service identifier.", "type": "string", "x-order": 3 }, - "cluster": { - "description": "Cluster name.", + "username": { + "description": "MySQL username for getting performance data.", "type": "string", "x-order": 4 }, - "replication_set": { - "description": "Replication set name.", - "type": "string", + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", "x-order": 5 }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 6 + }, + "tls_ca": { + "description": "Certificate Authority certificate chain.", + "type": "string", + "x-order": 7 + }, + "tls_cert": { + "description": "Client certificate.", + "type": "string", + "x-order": 8 + }, + "tls_key": { + "description": "Password for decrypting tls_cert.", + "type": "string", + "x-order": 9 + }, + "disable_comments_parsing": { + "description": "Disable parsing comments from queries and showing them in QAN.", + "type": "boolean", + "x-order": 10 + }, + "max_query_length": { + "description": "Limit query length in QAN (default: server-defined; -1: no limit).", + "type": "integer", + "format": "int32", + "x-order": 11 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 12 + }, "custom_labels": { "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 6 + "x-order": 13 }, - "group": { - "description": "Group name of external service.", + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", "type": "string", - "x-order": 7 + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ], + "x-order": 14 }, - "address": { - "description": "Access address (DNS name or IP).", + "process_exec_path": { + "description": "Path to exec process.", "type": "string", - "x-order": 8 + "x-order": 15 }, - "port": { - "description": "Access port.", - "type": "integer", - "format": "int64", - "x-order": 9 + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "x-order": 16 + }, + "extra_dsn_params": { + "description": "Extra DSN parameters for MySQL connection.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 17 } - } - } - } - }, - "haproxy": { - "type": "object", - "properties": { - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", + }, + "x-order": 2 + }, + "qan_mysql_slowlog": { + "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", "type": "object", "properties": { "agent_id": { @@ -3992,13 +4252,13 @@ "type": "string", "x-order": 0 }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", "type": "string", "x-order": 1 }, "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", + "description": "Desired Agent status: enabled (false) or disabled (true).", "type": "boolean", "x-order": 2 }, @@ -4008,69 +4268,64 @@ "x-order": 3 }, "username": { - "description": "HTTP basic auth username for collecting metrics.", + "description": "MySQL username for getting performance data.", "type": "string", "x-order": 4 }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", "x-order": 5 }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", "x-order": 6 }, + "tls_ca": { + "description": "Certificate Authority certificate chain.", + "type": "string", + "x-order": 7 + }, + "tls_cert": { + "description": "Client certificate.", + "type": "string", + "x-order": 8 + }, + "tls_key": { + "description": "Password for decrypting tls_cert.", + "type": "string", + "x-order": 9 + }, + "disable_comments_parsing": { + "description": "Disable parsing comments from queries and showing them in QAN.", + "type": "boolean", + "x-order": 10 + }, + "max_query_length": { + "type": "integer", + "format": "int32", + "title": "Limit query length in QAN (default: server-defined; -1: no limit)", + "x-order": 11 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 12 + }, + "max_slowlog_file_size": { + "description": "Slowlog file is rotated at this size if \u003e 0.", + "type": "string", + "format": "int64", + "x-order": 13 + }, "custom_labels": { "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 7 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 9 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 10 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname verification.", - "type": "boolean", - "x-order": 12 - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 2 - } - } + "x-order": 14 }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", @@ -4085,12 +4340,54 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ] + ], + "x-order": 15 + }, + "process_exec_path": { + "type": "string", + "title": "mod tidy", + "x-order": 16 + }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "x-order": 17 + }, + "extra_dsn_params": { + "description": "Extra DSN parameters for MySQL connection.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 18 } - } + }, + "x-order": 3 }, + "table_count": { + "description": "Actual table count at the moment of adding.", + "type": "integer", + "format": "int32", + "x-order": 4 + } + }, + "x-order": 0 + }, + "mongodb": { + "type": "object", + "properties": { "service": { - "description": "HAProxyService represents a generic HAProxy service instance.", + "description": "MongoDBService represents a generic MongoDB instance.", "type": "object", "properties": { "service_id": { @@ -4104,24 +4401,40 @@ "x-order": 1 }, "node_id": { - "description": "Node identifier where this service instance runs.", + "description": "Node identifier where this instance runs.", "type": "string", "x-order": 2 }, + "address": { + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 3 + }, + "port": { + "description": "Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", + "x-order": 4 + }, + "socket": { + "description": "Access unix socket.\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 5 + }, "environment": { "description": "Environment name.", "type": "string", - "x-order": 3 + "x-order": 6 }, "cluster": { "description": "Cluster name.", "type": "string", - "x-order": 4 + "x-order": 7 }, "replication_set": { "description": "Replication set name.", "type": "string", - "x-order": 5 + "x-order": 8 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -4129,15 +4442,16 @@ "additionalProperties": { "type": "string" }, - "x-order": 6 + "x-order": 9 + }, + "version": { + "description": "MongoDB version.", + "type": "string", + "x-order": 10 } - } - } - } - }, - "mongodb": { - "type": "object", - "properties": { + }, + "x-order": 0 + }, "mongodb_exporter": { "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics.", "type": "object", @@ -4198,6 +4512,22 @@ }, "x-order": 9 }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ], + "x-order": 10 + }, "listen_port": { "description": "Listen port for scraping metrics.", "type": "integer", @@ -4228,19 +4558,6 @@ "type": "string", "x-order": 15 }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 17 - }, - "environment_variable_names": { - "description": "Environment variable names passed to the exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 19 - }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", "type": "string", @@ -4253,7 +4570,13 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ] + ], + "x-order": 16 + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 17 }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -4274,27 +4597,22 @@ "type": "string", "x-order": 2 } - } + }, + "x-order": 18 }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ] + "environment_variable_names": { + "description": "Environment variable names passed to the exporter.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 19 } - } + }, + "x-order": 1 }, - "qan_mongodb_mongolog": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server.", + "qan_mongodb_profiler": { + "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server.", "type": "object", "properties": { "agent_id": { @@ -4346,6 +4664,22 @@ }, "x-order": 8 }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ], + "x-order": 9 + }, "process_exec_path": { "description": "Path to exec process.", "type": "string", @@ -4363,27 +4697,14 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ] - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ] + ], + "x-order": 11 } - } + }, + "x-order": 2 }, - "qan_mongodb_profiler": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server.", + "qan_mongodb_mongolog": { + "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server.", "type": "object", "properties": { "agent_id": { @@ -4435,25 +4756,6 @@ }, "x-order": 8 }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 10 - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] - }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", "type": "string", @@ -4467,9 +4769,31 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ] + ], + "x-order": 9 + }, + "process_exec_path": { + "description": "Path to exec process.", + "type": "string", + "x-order": 10 + }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "x-order": 11 } - } + }, + "x-order": 3 }, "rta_mongodb_agent": { "description": "RTAMongoDBAgent runs within pmm-agent and sends MongoDB Real-Time Query Analytics data to the PMM Server.", @@ -4518,20 +4842,6 @@ }, "x-order": 7 }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] - }, "rta_options": { "description": "RTAOptions holds Real-Time Query Analytics agent options.", "type": "object", @@ -4541,7 +4851,8 @@ "type": "string", "x-order": 0 } - } + }, + "x-order": 8 }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", @@ -4556,12 +4867,35 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ] + ], + "x-order": 9 + }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "x-order": 10 } - } - }, + }, + "x-order": 4 + } + }, + "x-order": 1 + }, + "postgresql": { + "type": "object", + "properties": { "service": { - "description": "MongoDBService represents a generic MongoDB instance.", + "description": "PostgreSQLService represents a generic PostgreSQL instance.", "type": "object", "properties": { "service_id": { @@ -4574,41 +4908,46 @@ "type": "string", "x-order": 1 }, + "database_name": { + "description": "Database name.", + "type": "string", + "x-order": 2 + }, "node_id": { "description": "Node identifier where this instance runs.", "type": "string", - "x-order": 2 + "x-order": 3 }, "address": { "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", "type": "string", - "x-order": 3 + "x-order": 4 }, "port": { "description": "Access port.\nPort is required when the address present.", "type": "integer", "format": "int64", - "x-order": 4 + "x-order": 5 }, "socket": { "description": "Access unix socket.\nAddress (and port) or socket is required.", "type": "string", - "x-order": 5 + "x-order": 6 }, "environment": { "description": "Environment name.", "type": "string", - "x-order": 6 + "x-order": 7 }, "cluster": { "description": "Cluster name.", "type": "string", - "x-order": 7 + "x-order": 8 }, "replication_set": { "description": "Replication set name.", "type": "string", - "x-order": 8 + "x-order": 9 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -4616,28 +4955,24 @@ "additionalProperties": { "type": "string" }, - "x-order": 9 + "x-order": 10 }, "version": { - "description": "MongoDB version.", + "description": "PostgreSQL version.", "type": "string", - "x-order": 10 + "x-order": 11 + }, + "auto_discovery_limit": { + "description": "Limit of databases for auto-discovery.", + "type": "integer", + "format": "int32", + "x-order": 12 } - } - } - } - }, - "mysql": { - "type": "object", - "properties": { - "table_count": { - "description": "Actual table count at the moment of adding.", - "type": "integer", - "format": "int32", - "x-order": 4 + }, + "x-order": 0 }, - "mysqld_exporter": { - "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "postgres_exporter": { + "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics.", "type": "object", "properties": { "agent_id": { @@ -4661,7 +4996,7 @@ "x-order": 3 }, "username": { - "description": "MySQL username for scraping metrics.", + "description": "PostgreSQL username for scraping metrics.", "type": "string", "x-order": 4 }, @@ -4671,43 +5006,22 @@ "x-order": 5 }, "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", + "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", "type": "boolean", "x-order": 6 }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 7 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 8 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 9 - }, - "tablestats_group_table_limit": { - "description": "Tablestats group collectors are disabled if there are more than that number of tables.\n0 means tablestats group collectors are always enabled (no limit).\nNegative value means tablestats group collectors are always disabled.", - "type": "integer", - "format": "int32", - "x-order": 10 - }, "custom_labels": { "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 11 + "x-order": 7 }, "push_metrics_enabled": { "description": "True if exporter uses push metrics mode.", "type": "boolean", - "x-order": 12 + "x-order": 8 }, "disabled_collectors": { "description": "List of disabled collector names.", @@ -4715,42 +5029,34 @@ "items": { "type": "string" }, - "x-order": 13 + "x-order": 9 }, - "table_count": { - "description": "Actual table count at the moment of adding.", - "type": "integer", - "format": "int32", - "x-order": 14 + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ], + "x-order": 10 }, "listen_port": { "description": "Listen port for scraping metrics.", "type": "integer", "format": "int64", - "x-order": 16 - }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", - "type": "boolean", - "x-order": 17 + "x-order": 11 }, "process_exec_path": { "description": "Path to exec process.", "type": "string", - "x-order": 18 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 20 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 22 + "x-order": 12 }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", @@ -4764,7 +5070,25 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ] + ], + "x-order": 13 + }, + "auto_discovery_limit": { + "description": "Limit of databases for auto-discovery.", + "type": "integer", + "format": "int32", + "x-order": 14 + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 15 + }, + "max_exporter_connections": { + "description": "Maximum number of connections that exporter can open to the database instance.", + "type": "integer", + "format": "int32", + "x-order": 16 }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -4785,7 +5109,69 @@ "type": "string", "x-order": 2 } - } + }, + "x-order": 17 + } + }, + "x-order": 1 + }, + "qan_postgresql_pgstatements_agent": { + "description": "QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "agent_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "service_id": { + "description": "Service identifier.", + "type": "string", + "x-order": 3 + }, + "username": { + "description": "PostgreSQL username for getting pg stat statements data.", + "type": "string", + "x-order": 4 + }, + "disable_comments_parsing": { + "description": "Disable parsing comments from queries and showing them in QAN.", + "type": "boolean", + "x-order": 5 + }, + "max_query_length": { + "description": "Limit query length in QAN (default: server-defined; -1: no limit).", + "type": "integer", + "format": "int32", + "x-order": 6 + }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 7 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", @@ -4800,12 +5186,34 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ] + ], + "x-order": 10 + }, + "process_exec_path": { + "description": "Path to exec process.", + "type": "string", + "x-order": 11 + }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "x-order": 12 } - } + }, + "x-order": 2 }, - "qan_mysql_perfschema": { - "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "qan_postgresql_pgstatmonitor_agent": { + "description": "QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", "type": "object", "properties": { "agent_id": { @@ -4829,7 +5237,7 @@ "x-order": 3 }, "username": { - "description": "MySQL username for getting performance data.", + "description": "PostgreSQL username for getting pg stat monitor data.", "type": "string", "x-order": 4 }, @@ -4843,36 +5251,21 @@ "type": "boolean", "x-order": 6 }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 7 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 8 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 9 - }, "disable_comments_parsing": { "description": "Disable parsing comments from queries and showing them in QAN.", "type": "boolean", - "x-order": 10 + "x-order": 7 }, "max_query_length": { "description": "Limit query length in QAN (default: server-defined; -1: no limit).", "type": "integer", "format": "int32", - "x-order": 11 + "x-order": 8 }, "query_examples_disabled": { "description": "True if query examples are disabled.", "type": "boolean", - "x-order": 12 + "x-order": 9 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -4880,20 +5273,28 @@ "additionalProperties": { "type": "string" }, - "x-order": 13 + "x-order": 10 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ], + "x-order": 11 }, "process_exec_path": { "description": "Path to exec process.", "type": "string", - "x-order": 15 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 17 + "x-order": 12 }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", @@ -4907,27 +5308,91 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ] + ], + "x-order": 13 + } + }, + "x-order": 3 + }, + "warning": { + "description": "Warning message.", + "type": "string", + "x-order": 4 + } + }, + "x-order": 2 + }, + "proxysql": { + "type": "object", + "properties": { + "service": { + "description": "ProxySQLService represents a generic ProxySQL instance.", + "type": "object", + "properties": { + "service_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "service_name": { + "description": "Unique across all Services user-defined name.", "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ] + "x-order": 1 + }, + "node_id": { + "description": "Node identifier where this instance runs.", + "type": "string", + "x-order": 2 + }, + "address": { + "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 3 + }, + "port": { + "description": "Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", + "x-order": 4 + }, + "socket": { + "description": "Access unix socket.\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 5 + }, + "environment": { + "description": "Environment name.", + "type": "string", + "x-order": 6 + }, + "cluster": { + "description": "Cluster name.", + "type": "string", + "x-order": 7 + }, + "replication_set": { + "description": "Replication set name.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + }, + "version": { + "description": "ProxySQL version.", + "type": "string", + "x-order": 10 } - } + }, + "x-order": 0 }, - "qan_mysql_slowlog": { - "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "proxysql_exporter": { + "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics.", "type": "object", "properties": { "agent_id": { @@ -4951,7 +5416,7 @@ "x-order": 3 }, "username": { - "description": "MySQL username for getting performance data.", + "description": "ProxySQL username for scraping metrics.", "type": "string", "x-order": 4 }, @@ -4965,63 +5430,53 @@ "type": "boolean", "x-order": 6 }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, "x-order": 7 }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", "x-order": 8 }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", + "disabled_collectors": { + "description": "List of disabled collector names.", + "type": "array", + "items": { + "type": "string" + }, "x-order": 9 }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ], "x-order": 10 }, - "max_query_length": { + "listen_port": { + "description": "Listen port for scraping metrics.", "type": "integer", - "format": "int32", - "title": "Limit query length in QAN (default: server-defined; -1: no limit)", - "x-order": 11 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 12 - }, - "max_slowlog_file_size": { - "description": "Slowlog file is rotated at this size if \u003e 0.", - "type": "string", "format": "int64", - "x-order": 13 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 + "x-order": 11 }, "process_exec_path": { + "description": "Path to exec process.", "type": "string", - "title": "mod tidy", - "x-order": 16 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 18 + "x-order": 12 }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", @@ -5035,27 +5490,47 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ] + ], + "x-order": 13 }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ] + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 14 + }, + "metrics_resolutions": { + "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", + "type": "object", + "properties": { + "hr": { + "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 0 + }, + "mr": { + "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 1 + }, + "lr": { + "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 2 + } + }, + "x-order": 15 } - } - }, + }, + "x-order": 1 + } + }, + "x-order": 3 + }, + "haproxy": { + "type": "object", + "properties": { "service": { - "description": "MySQLService represents a generic MySQL instance.", + "description": "HAProxyService represents a generic HAProxy service instance.", "type": "object", "properties": { "service_id": { @@ -5069,40 +5544,24 @@ "x-order": 1 }, "node_id": { - "description": "Node identifier where this instance runs.", + "description": "Node identifier where this service instance runs.", "type": "string", "x-order": 2 }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 3 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 4 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 5 - }, "environment": { "description": "Environment name.", "type": "string", - "x-order": 6 + "x-order": 3 }, "cluster": { "description": "Cluster name.", "type": "string", - "x-order": 7 + "x-order": 4 }, "replication_set": { "description": "Replication set name.", "type": "string", - "x-order": 8 + "x-order": 5 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -5110,35 +5569,13 @@ "additionalProperties": { "type": "string" }, - "x-order": 9 - }, - "version": { - "description": "MySQL version.", - "type": "string", - "x-order": 10 - }, - "extra_dsn_params": { - "description": "Extra parameters to be added to the DSN.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 + "x-order": 6 } - } - } - } - }, - "postgresql": { - "type": "object", - "properties": { - "warning": { - "description": "Warning message.", - "type": "string", - "x-order": 4 + }, + "x-order": 0 }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics.", + "external_exporter": { + "description": "ExternalExporter runs on any Node type, including Remote Node.", "type": "object", "properties": { "agent_id": { @@ -5146,13 +5583,13 @@ "type": "string", "x-order": 0 }, - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", + "runs_on_node_id": { + "description": "Node identifier where this instance runs.", "type": "string", "x-order": 1 }, "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", + "description": "If disabled, metrics from this exporter will not be collected.", "type": "boolean", "x-order": 2 }, @@ -5162,18 +5599,18 @@ "x-order": 3 }, "username": { - "description": "PostgreSQL username for scraping metrics.", + "description": "HTTP basic auth username for collecting metrics.", "type": "string", "x-order": 4 }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", + "scheme": { + "description": "Scheme to generate URI to exporter metrics endpoints.", + "type": "string", "x-order": 5 }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", - "type": "boolean", + "metrics_path": { + "description": "Path under which metrics are exposed, used to generate URI.", + "type": "string", "x-order": 6 }, "custom_labels": { @@ -5184,60 +5621,21 @@ }, "x-order": 7 }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 8 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - }, "listen_port": { "description": "Listen port for scraping metrics.", "type": "integer", "format": "int64", - "x-order": 11 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 12 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 14 + "x-order": 8 }, - "expose_exporter": { + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 15 - }, - "max_exporter_connections": { - "description": "Maximum number of connections that exporter can open to the database instance.", - "type": "integer", - "format": "int32", - "x-order": 16 + "x-order": 9 }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "process_exec_path": { + "description": "Path to exec process.", "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] + "x-order": 10 }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -5258,7 +5656,13 @@ "type": "string", "x-order": 2 } - } + }, + "x-order": 11 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname verification.", + "type": "boolean", + "x-order": 12 }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", @@ -5273,106 +5677,81 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ] + ], + "x-order": 13 } - } - }, - "qan_postgresql_pgstatements_agent": { - "description": "QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", + }, + "x-order": 1 + } + }, + "x-order": 4 + }, + "external": { + "type": "object", + "properties": { + "service": { + "description": "ExternalService represents a generic External service instance.", "type": "object", "properties": { - "agent_id": { + "service_id": { "description": "Unique randomly generated instance identifier.", "type": "string", "x-order": 0 }, - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", + "service_name": { + "description": "Unique across all Services user-defined name.", "type": "string", "x-order": 1 }, - "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", - "type": "boolean", + "node_id": { + "description": "Node identifier where this service instance runs.", + "type": "string", "x-order": 2 }, - "service_id": { - "description": "Service identifier.", + "environment": { + "description": "Environment name.", "type": "string", "x-order": 3 }, - "username": { - "description": "PostgreSQL username for getting pg stat statements data.", + "cluster": { + "description": "Cluster name.", "type": "string", "x-order": 4 }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", + "replication_set": { + "description": "Replication set name.", + "type": "string", "x-order": 5 }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 6 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 7 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 8 - }, "custom_labels": { "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 9 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 11 + "x-order": 6 }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "group": { + "description": "Group name of external service.", "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] + "x-order": 7 }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "address": { + "description": "Access address (DNS name or IP).", "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ] + "x-order": 8 + }, + "port": { + "description": "Access port.", + "type": "integer", + "format": "int64", + "x-order": 9 } - } + }, + "x-order": 0 }, - "qan_postgresql_pgstatmonitor_agent": { - "description": "QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", + "external_exporter": { + "description": "ExternalExporter runs on any Node type, including Remote Node.", "type": "object", "properties": { "agent_id": { @@ -5380,13 +5759,13 @@ "type": "string", "x-order": 0 }, - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", + "runs_on_node_id": { + "description": "Node identifier where this instance runs.", "type": "string", "x-order": 1 }, "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", + "description": "If disabled, metrics from this exporter will not be collected.", "type": "boolean", "x-order": 2 }, @@ -5396,62 +5775,70 @@ "x-order": 3 }, "username": { - "description": "PostgreSQL username for getting pg stat monitor data.", + "description": "HTTP basic auth username for collecting metrics.", "type": "string", "x-order": 4 }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", + "scheme": { + "description": "Scheme to generate URI to exporter metrics endpoints.", + "type": "string", "x-order": 5 }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", + "metrics_path": { + "description": "Path under which metrics are exposed, used to generate URI.", + "type": "string", "x-order": 6 }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, "x-order": 7 }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", + "listen_port": { + "description": "Listen port for scraping metrics.", "type": "integer", - "format": "int32", + "format": "int64", "x-order": 8 }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", "type": "boolean", "x-order": 9 }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, "process_exec_path": { "description": "Path to exec process.", "type": "string", - "x-order": 12 + "x-order": 10 }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] + "metrics_resolutions": { + "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", + "type": "object", + "properties": { + "hr": { + "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 0 + }, + "mr": { + "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 1 + }, + "lr": { + "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 2 + } + }, + "x-order": 11 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname verification.", + "type": "boolean", + "x-order": 12 }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", @@ -5466,64 +5853,51 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ] + ], + "x-order": 13 } - } - }, - "service": { - "description": "PostgreSQLService represents a generic PostgreSQL instance.", + }, + "x-order": 1 + } + }, + "x-order": 5 + }, + "rds": { + "type": "object", + "properties": { + "node": { + "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", "type": "object", "properties": { - "service_id": { + "node_id": { "description": "Unique randomly generated instance identifier.", "type": "string", "x-order": 0 }, - "service_name": { - "description": "Unique across all Services user-defined name.", + "node_name": { + "description": "Unique across all Nodes user-defined name.", "type": "string", "x-order": 1 }, - "database_name": { - "description": "Database name.", + "address": { + "description": "DB instance identifier.", "type": "string", "x-order": 2 }, - "node_id": { - "description": "Node identifier where this instance runs.", + "node_model": { + "description": "Node model.", "type": "string", "x-order": 3 }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", + "region": { + "description": "Node region.", "type": "string", "x-order": 4 }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 5 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 6 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 7 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 8 - }, - "replication_set": { - "description": "Replication set name.", + "az": { + "description": "Node availability zone.", "type": "string", - "x-order": 9 + "x-order": 5 }, "custom_labels": { "description": "Custom user-assigned labels.", @@ -5531,28 +5905,18 @@ "additionalProperties": { "type": "string" }, - "x-order": 10 + "x-order": 6 }, - "version": { - "description": "PostgreSQL version.", + "instance_id": { + "description": "AWS instance ID.", "type": "string", - "x-order": 11 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 12 + "x-order": 7 } - } - } - } - }, - "proxysql": { - "type": "object", - "properties": { - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics.", + }, + "x-order": 0 + }, + "rds_exporter": { + "description": "RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics.", "type": "object", "properties": { "agent_id": { @@ -5570,62 +5934,65 @@ "type": "boolean", "x-order": 2 }, - "service_id": { - "description": "Service identifier.", + "node_id": { + "description": "Node identifier.", "type": "string", "x-order": 3 }, - "username": { - "description": "ProxySQL username for scraping metrics.", + "aws_access_key": { + "description": "AWS Access Key.", "type": "string", "x-order": 4 }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 5 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 6 - }, "custom_labels": { "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" }, + "x-order": 5 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ], + "x-order": 6 + }, + "listen_port": { + "description": "Listen port for scraping metrics (the same for several configurations).", + "type": "integer", + "format": "int64", "x-order": 7 }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", + "basic_metrics_disabled": { + "description": "Basic metrics are disabled.", "type": "boolean", "x-order": 8 }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "type": "string" - }, + "enhanced_metrics_disabled": { + "description": "Enhanced metrics are disabled.", + "type": "boolean", "x-order": 9 }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", + "x-order": 10 }, "process_exec_path": { "description": "Path to exec process.", "type": "string", - "x-order": 12 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 14 + "x-order": 11 }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", @@ -5639,7 +6006,14 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ] + ], + "x-order": 12 + }, + "auto_discovery_limit": { + "description": "Limit of databases for auto-discovery.", + "type": "integer", + "format": "int32", + "x-order": 13 }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -5660,95 +6034,12 @@ "type": "string", "x-order": 2 } - } - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ] - } - } - }, - "service": { - "description": "ProxySQLService represents a generic ProxySQL instance.", - "type": "object", - "properties": { - "service_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "service_name": { - "description": "Unique across all Services user-defined name.", - "type": "string", - "x-order": 1 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 2 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 3 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 4 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 5 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 6 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 7 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" }, - "x-order": 9 - }, - "version": { - "description": "ProxySQL version.", - "type": "string", - "x-order": 10 + "x-order": 14 } - } - } - } - }, - "rds": { - "type": "object", - "properties": { + }, + "x-order": 1 + }, "mysql": { "description": "MySQLService represents a generic MySQL instance.", "type": "object", @@ -5820,7 +6111,8 @@ }, "x-order": 11 } - } + }, + "x-order": 2 }, "mysqld_exporter": { "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", @@ -5909,6 +6201,22 @@ "format": "int32", "x-order": 14 }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ], + "x-order": 15 + }, "listen_port": { "description": "Listen port for scraping metrics.", "type": "integer", @@ -5925,53 +6233,136 @@ "type": "string", "x-order": 18 }, + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", + "type": "string", + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "x-order": 19 + }, "expose_exporter": { "type": "boolean", "title": "Optionally expose the exporter process on all public interfaces", "x-order": 20 }, + "metrics_resolutions": { + "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", + "type": "object", + "properties": { + "hr": { + "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 0 + }, + "mr": { + "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 1 + }, + "lr": { + "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 2 + } + }, + "x-order": 21 + }, "extra_dsn_params": { "description": "Extra DSN parameters for MySQL connection.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 22 - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 2 - } - } + "x-order": 22 + } + }, + "x-order": 3 + }, + "qan_mysql_perfschema": { + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "agent_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "service_id": { + "description": "Service identifier.", + "type": "string", + "x-order": 3 + }, + "username": { + "description": "MySQL username for getting performance data.", + "type": "string", + "x-order": 4 + }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 5 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 6 + }, + "tls_ca": { + "description": "Certificate Authority certificate chain.", + "type": "string", + "x-order": 7 + }, + "tls_cert": { + "description": "Client certificate.", + "type": "string", + "x-order": 8 + }, + "tls_key": { + "description": "Password for decrypting tls_cert.", + "type": "string", + "x-order": 9 + }, + "disable_comments_parsing": { + "description": "Disable parsing comments from queries and showing them in QAN.", + "type": "boolean", + "x-order": 10 + }, + "max_query_length": { + "description": "Limit query length in QAN (default: server-defined; -1: no limit).", + "type": "integer", + "format": "int32", + "x-order": 11 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 12 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 13 }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", @@ -5986,58 +6377,39 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ] - } - } - }, - "node": { - "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 + ], + "x-order": 14 }, - "region": { - "description": "Node region.", + "process_exec_path": { + "description": "Path to exec process.", "type": "string", - "x-order": 4 + "x-order": 15 }, - "az": { - "description": "Node availability zone.", + "log_level": { + "description": "- LOG_LEVEL_UNSPECIFIED: Auto", "type": "string", - "x-order": 5 + "title": "Log level for exporters", + "default": "LOG_LEVEL_UNSPECIFIED", + "enum": [ + "LOG_LEVEL_UNSPECIFIED", + "LOG_LEVEL_FATAL", + "LOG_LEVEL_ERROR", + "LOG_LEVEL_WARN", + "LOG_LEVEL_INFO", + "LOG_LEVEL_DEBUG" + ], + "x-order": 16 }, - "custom_labels": { - "description": "Custom user-assigned labels.", + "extra_dsn_params": { + "description": "Extra DSN parameters for MySQL connection.", "type": "object", "additionalProperties": { "type": "string" }, - "x-order": 6 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 7 + "x-order": 17 } - } + }, + "x-order": 4 }, "postgresql": { "description": "PostgreSQLService represents a generic PostgreSQL instance.", @@ -6113,7 +6485,8 @@ "format": "int32", "x-order": 12 } - } + }, + "x-order": 5 }, "postgresql_exporter": { "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics.", @@ -6175,69 +6548,6 @@ }, "x-order": 9 }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 12 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 14 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 15 - }, - "max_exporter_connections": { - "description": "Maximum number of connections that exporter can open to the database instance.", - "type": "integer", - "format": "int32", - "x-order": 16 - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 2 - } - } - }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", "type": "string", @@ -6251,100 +6561,19 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ] - } - } - }, - "qan_mysql_perfschema": { - "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "MySQL username for getting performance data.", - "type": "string", - "x-order": 4 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 5 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 6 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 7 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 8 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 9 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", + ], "x-order": 10 }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", + "listen_port": { + "description": "Listen port for scraping metrics.", "type": "integer", - "format": "int32", - "x-order": 11 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 12 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 13 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 17 + "format": "int64", + "x-order": 11 + }, + "process_exec_path": { + "description": "Path to exec process.", + "type": "string", + "x-order": 12 }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", @@ -6358,24 +6587,50 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ] + ], + "x-order": 13 }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ] + "auto_discovery_limit": { + "description": "Limit of databases for auto-discovery.", + "type": "integer", + "format": "int32", + "x-order": 14 + }, + "expose_exporter": { + "type": "boolean", + "title": "Optionally expose the exporter process on all public interfaces", + "x-order": 15 + }, + "max_exporter_connections": { + "description": "Maximum number of connections that exporter can open to the database instance.", + "type": "integer", + "format": "int32", + "x-order": 16 + }, + "metrics_resolutions": { + "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", + "type": "object", + "properties": { + "hr": { + "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 0 + }, + "mr": { + "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 1 + }, + "lr": { + "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", + "type": "string", + "x-order": 2 + } + }, + "x-order": 17 } - } + }, + "x-order": 6 }, "qan_postgresql_pgstatements": { "description": "QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", @@ -6435,25 +6690,6 @@ }, "x-order": 9 }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 11 - }, - "log_level": { - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "type": "string", - "title": "Log level for exporters", - "default": "LOG_LEVEL_UNSPECIFIED", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ] - }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", "type": "string", @@ -6467,66 +6703,7 @@ "AGENT_STATUS_STOPPING", "AGENT_STATUS_DONE", "AGENT_STATUS_UNKNOWN" - ] - } - } - }, - "rds_exporter": { - "description": "RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", - "type": "boolean", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier.", - "type": "string", - "x-order": 3 - }, - "aws_access_key": { - "description": "AWS Access Key.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "basic_metrics_disabled": { - "description": "Basic metrics are disabled.", - "type": "boolean", - "x-order": 8 - }, - "enhanced_metrics_disabled": { - "description": "Enhanced metrics are disabled.", - "type": "boolean", - "x-order": 9 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", + ], "x-order": 10 }, "process_exec_path": { @@ -6534,12 +6711,6 @@ "type": "string", "x-order": 11 }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 13 - }, "log_level": { "description": "- LOG_LEVEL_UNSPECIFIED: Auto", "type": "string", @@ -6552,47 +6723,14 @@ "LOG_LEVEL_WARN", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG" - ] - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix.", - "type": "string", - "x-order": 2 - } - } - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ] + ], + "x-order": 12 } - } + }, + "x-order": 7 } - } + }, + "x-order": 6 }, "valkey": { "type": "object", @@ -6660,7 +6798,8 @@ "type": "string", "x-order": 10 } - } + }, + "x-order": 0 }, "valkey_exporter": { "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey Service metrics.", @@ -6722,6 +6861,22 @@ }, "x-order": 9 }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_UNSPECIFIED", + "enum": [ + "AGENT_STATUS_UNSPECIFIED", + "AGENT_STATUS_STARTING", + "AGENT_STATUS_INITIALIZATION_ERROR", + "AGENT_STATUS_RUNNING", + "AGENT_STATUS_WAITING", + "AGENT_STATUS_STOPPING", + "AGENT_STATUS_DONE", + "AGENT_STATUS_UNKNOWN" + ], + "x-order": 10 + }, "listen_port": { "description": "Listen port for scraping metrics.", "type": "integer", @@ -6757,26 +6912,14 @@ "type": "string", "x-order": 2 } - } - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_UNSPECIFIED", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ] + }, + "x-order": 14 } - } + }, + "x-order": 1 } - } + }, + "x-order": 7 } } } @@ -6964,7 +7107,8 @@ "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", "DISCOVER_AZURE_DATABASE_TYPE_MYSQL", "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" - ] + ], + "x-order": 24 } } } @@ -7176,6 +7320,17 @@ "type": "string", "x-order": 6 }, + "type": { + "description": "DiscoverAzureDatabaseType describes supported Azure Database instance engines.\n\n - DISCOVER_AZURE_DATABASE_TYPE_MYSQL: MySQL type: microsoft.dbformysql or MariaDB type: microsoft.dbformariadb\n - DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL: PostgreSQL type: microsoft.dbformysql", + "type": "string", + "default": "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", + "enum": [ + "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", + "DISCOVER_AZURE_DATABASE_TYPE_MYSQL", + "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" + ], + "x-order": 7 + }, "az": { "description": "Azure database availability zone.", "type": "string", @@ -7185,16 +7340,6 @@ "description": "Represents a purchasable Stock Keeping Unit (SKU) under a product.\nhttps://docs.microsoft.com/en-us/partner-center/develop/product-resources#sku.", "type": "string", "x-order": 9 - }, - "type": { - "description": "DiscoverAzureDatabaseType describes supported Azure Database instance engines.\n\n - DISCOVER_AZURE_DATABASE_TYPE_MYSQL: MySQL type: microsoft.dbformysql or MariaDB type: microsoft.dbformariadb\n - DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL: PostgreSQL type: microsoft.dbformysql", - "type": "string", - "default": "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", - "enum": [ - "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", - "DISCOVER_AZURE_DATABASE_TYPE_MYSQL", - "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" - ] } } }, @@ -7310,11 +7455,6 @@ "format": "int64", "x-order": 5 }, - "engine_version": { - "description": "Engine version.", - "type": "string", - "x-order": 7 - }, "engine": { "description": "DiscoverRDSEngine describes supported RDS instance engines.", "type": "string", @@ -7323,7 +7463,13 @@ "DISCOVER_RDS_ENGINE_UNSPECIFIED", "DISCOVER_RDS_ENGINE_MYSQL", "DISCOVER_RDS_ENGINE_POSTGRESQL" - ] + ], + "x-order": 6 + }, + "engine_version": { + "description": "Engine version.", + "type": "string", + "x-order": 7 } } }, diff --git a/api/management/v1/metrics.pb.go b/api/management/v1/metrics.pb.go index 4e15adc6171..af41e8e2ebb 100644 --- a/api/management/v1/metrics.pb.go +++ b/api/management/v1/metrics.pb.go @@ -7,11 +7,12 @@ package managementv1 import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -96,10 +97,13 @@ func file_management_v1_metrics_proto_rawDescGZIP() []byte { return file_management_v1_metrics_proto_rawDescData } -var file_management_v1_metrics_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_management_v1_metrics_proto_goTypes = []any{ - (MetricsMode)(0), // 0: management.v1.MetricsMode -} +var ( + file_management_v1_metrics_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_management_v1_metrics_proto_goTypes = []any{ + (MetricsMode)(0), // 0: management.v1.MetricsMode + } +) + var file_management_v1_metrics_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/management/v1/metrics.swagger.json b/api/management/v1/metrics.swagger.json deleted file mode 100644 index 48c8c4ec4ca..00000000000 --- a/api/management/v1/metrics.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/metrics.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/management/v1/mongodb.pb.go b/api/management/v1/mongodb.pb.go index 371190431cf..5fc9584c35c 100644 --- a/api/management/v1/mongodb.pb.go +++ b/api/management/v1/mongodb.pb.go @@ -7,13 +7,15 @@ package managementv1 import ( - _ "github.com/envoyproxy/protoc-gen-validate/validate" - v1 "github.com/percona/pmm/api/inventory/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -528,20 +530,23 @@ func file_management_v1_mongodb_proto_rawDescGZIP() []byte { return file_management_v1_mongodb_proto_rawDescData } -var file_management_v1_mongodb_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_management_v1_mongodb_proto_goTypes = []any{ - (*AddMongoDBServiceParams)(nil), // 0: management.v1.AddMongoDBServiceParams - (*MongoDBServiceResult)(nil), // 1: management.v1.MongoDBServiceResult - nil, // 2: management.v1.AddMongoDBServiceParams.CustomLabelsEntry - (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams - (MetricsMode)(0), // 4: management.v1.MetricsMode - (v1.LogLevel)(0), // 5: inventory.v1.LogLevel - (*v1.MongoDBService)(nil), // 6: inventory.v1.MongoDBService - (*v1.MongoDBExporter)(nil), // 7: inventory.v1.MongoDBExporter - (*v1.QANMongoDBProfilerAgent)(nil), // 8: inventory.v1.QANMongoDBProfilerAgent - (*v1.QANMongoDBMongologAgent)(nil), // 9: inventory.v1.QANMongoDBMongologAgent - (*v1.RTAMongoDBAgent)(nil), // 10: inventory.v1.RTAMongoDBAgent -} +var ( + file_management_v1_mongodb_proto_msgTypes = make([]protoimpl.MessageInfo, 3) + file_management_v1_mongodb_proto_goTypes = []any{ + (*AddMongoDBServiceParams)(nil), // 0: management.v1.AddMongoDBServiceParams + (*MongoDBServiceResult)(nil), // 1: management.v1.MongoDBServiceResult + nil, // 2: management.v1.AddMongoDBServiceParams.CustomLabelsEntry + (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams + (MetricsMode)(0), // 4: management.v1.MetricsMode + (v1.LogLevel)(0), // 5: inventory.v1.LogLevel + (*v1.MongoDBService)(nil), // 6: inventory.v1.MongoDBService + (*v1.MongoDBExporter)(nil), // 7: inventory.v1.MongoDBExporter + (*v1.QANMongoDBProfilerAgent)(nil), // 8: inventory.v1.QANMongoDBProfilerAgent + (*v1.QANMongoDBMongologAgent)(nil), // 9: inventory.v1.QANMongoDBMongologAgent + (*v1.RTAMongoDBAgent)(nil), // 10: inventory.v1.RTAMongoDBAgent + } +) + var file_management_v1_mongodb_proto_depIdxs = []int32{ 3, // 0: management.v1.AddMongoDBServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddMongoDBServiceParams.custom_labels:type_name -> management.v1.AddMongoDBServiceParams.CustomLabelsEntry diff --git a/api/management/v1/mongodb.swagger.json b/api/management/v1/mongodb.swagger.json deleted file mode 100644 index 2722b769cf7..00000000000 --- a/api/management/v1/mongodb.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/mongodb.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/management/v1/mysql.pb.go b/api/management/v1/mysql.pb.go index 97ee6ed09fb..880618f4403 100644 --- a/api/management/v1/mysql.pb.go +++ b/api/management/v1/mysql.pb.go @@ -7,13 +7,15 @@ package managementv1 import ( - _ "github.com/envoyproxy/protoc-gen-validate/validate" - v1 "github.com/percona/pmm/api/inventory/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -514,20 +516,23 @@ func file_management_v1_mysql_proto_rawDescGZIP() []byte { return file_management_v1_mysql_proto_rawDescData } -var file_management_v1_mysql_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_management_v1_mysql_proto_goTypes = []any{ - (*AddMySQLServiceParams)(nil), // 0: management.v1.AddMySQLServiceParams - (*MySQLServiceResult)(nil), // 1: management.v1.MySQLServiceResult - nil, // 2: management.v1.AddMySQLServiceParams.CustomLabelsEntry - nil, // 3: management.v1.AddMySQLServiceParams.ExtraDsnParamsEntry - (*AddNodeParams)(nil), // 4: management.v1.AddNodeParams - (MetricsMode)(0), // 5: management.v1.MetricsMode - (v1.LogLevel)(0), // 6: inventory.v1.LogLevel - (*v1.MySQLService)(nil), // 7: inventory.v1.MySQLService - (*v1.MySQLdExporter)(nil), // 8: inventory.v1.MySQLdExporter - (*v1.QANMySQLPerfSchemaAgent)(nil), // 9: inventory.v1.QANMySQLPerfSchemaAgent - (*v1.QANMySQLSlowlogAgent)(nil), // 10: inventory.v1.QANMySQLSlowlogAgent -} +var ( + file_management_v1_mysql_proto_msgTypes = make([]protoimpl.MessageInfo, 4) + file_management_v1_mysql_proto_goTypes = []any{ + (*AddMySQLServiceParams)(nil), // 0: management.v1.AddMySQLServiceParams + (*MySQLServiceResult)(nil), // 1: management.v1.MySQLServiceResult + nil, // 2: management.v1.AddMySQLServiceParams.CustomLabelsEntry + nil, // 3: management.v1.AddMySQLServiceParams.ExtraDsnParamsEntry + (*AddNodeParams)(nil), // 4: management.v1.AddNodeParams + (MetricsMode)(0), // 5: management.v1.MetricsMode + (v1.LogLevel)(0), // 6: inventory.v1.LogLevel + (*v1.MySQLService)(nil), // 7: inventory.v1.MySQLService + (*v1.MySQLdExporter)(nil), // 8: inventory.v1.MySQLdExporter + (*v1.QANMySQLPerfSchemaAgent)(nil), // 9: inventory.v1.QANMySQLPerfSchemaAgent + (*v1.QANMySQLSlowlogAgent)(nil), // 10: inventory.v1.QANMySQLSlowlogAgent + } +) + var file_management_v1_mysql_proto_depIdxs = []int32{ 4, // 0: management.v1.AddMySQLServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddMySQLServiceParams.custom_labels:type_name -> management.v1.AddMySQLServiceParams.CustomLabelsEntry diff --git a/api/management/v1/mysql.swagger.json b/api/management/v1/mysql.swagger.json deleted file mode 100644 index f0be3fa24f2..00000000000 --- a/api/management/v1/mysql.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/mysql.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/management/v1/node.pb.go b/api/management/v1/node.pb.go index 1af3670f2e7..e4d8f1ce979 100644 --- a/api/management/v1/node.pb.go +++ b/api/management/v1/node.pb.go @@ -7,14 +7,16 @@ package managementv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" - v1 "github.com/percona/pmm/api/inventory/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -1354,34 +1356,37 @@ func file_management_v1_node_proto_rawDescGZIP() []byte { return file_management_v1_node_proto_rawDescData } -var file_management_v1_node_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_management_v1_node_proto_msgTypes = make([]protoimpl.MessageInfo, 17) -var file_management_v1_node_proto_goTypes = []any{ - (UniversalNode_Status)(0), // 0: management.v1.UniversalNode.Status - (*AddNodeParams)(nil), // 1: management.v1.AddNodeParams - (*RegisterNodeRequest)(nil), // 2: management.v1.RegisterNodeRequest - (*RegisterNodeResponse)(nil), // 3: management.v1.RegisterNodeResponse - (*UnregisterNodeRequest)(nil), // 4: management.v1.UnregisterNodeRequest - (*UnregisterNodeResponse)(nil), // 5: management.v1.UnregisterNodeResponse - (*UniversalNode)(nil), // 6: management.v1.UniversalNode - (*ListNodesRequest)(nil), // 7: management.v1.ListNodesRequest - (*ListNodesResponse)(nil), // 8: management.v1.ListNodesResponse - (*GetNodeRequest)(nil), // 9: management.v1.GetNodeRequest - (*GetNodeResponse)(nil), // 10: management.v1.GetNodeResponse - (*CreateNodeInstallTokenRequest)(nil), // 11: management.v1.CreateNodeInstallTokenRequest - (*CreateNodeInstallTokenResponse)(nil), // 12: management.v1.CreateNodeInstallTokenResponse - nil, // 13: management.v1.AddNodeParams.CustomLabelsEntry - nil, // 14: management.v1.RegisterNodeRequest.CustomLabelsEntry - (*UniversalNode_Service)(nil), // 15: management.v1.UniversalNode.Service - (*UniversalNode_Agent)(nil), // 16: management.v1.UniversalNode.Agent - nil, // 17: management.v1.UniversalNode.CustomLabelsEntry - (v1.NodeType)(0), // 18: inventory.v1.NodeType - (MetricsMode)(0), // 19: management.v1.MetricsMode - (*v1.GenericNode)(nil), // 20: inventory.v1.GenericNode - (*v1.ContainerNode)(nil), // 21: inventory.v1.ContainerNode - (*v1.PMMAgent)(nil), // 22: inventory.v1.PMMAgent - (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp -} +var ( + file_management_v1_node_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_management_v1_node_proto_msgTypes = make([]protoimpl.MessageInfo, 17) + file_management_v1_node_proto_goTypes = []any{ + (UniversalNode_Status)(0), // 0: management.v1.UniversalNode.Status + (*AddNodeParams)(nil), // 1: management.v1.AddNodeParams + (*RegisterNodeRequest)(nil), // 2: management.v1.RegisterNodeRequest + (*RegisterNodeResponse)(nil), // 3: management.v1.RegisterNodeResponse + (*UnregisterNodeRequest)(nil), // 4: management.v1.UnregisterNodeRequest + (*UnregisterNodeResponse)(nil), // 5: management.v1.UnregisterNodeResponse + (*UniversalNode)(nil), // 6: management.v1.UniversalNode + (*ListNodesRequest)(nil), // 7: management.v1.ListNodesRequest + (*ListNodesResponse)(nil), // 8: management.v1.ListNodesResponse + (*GetNodeRequest)(nil), // 9: management.v1.GetNodeRequest + (*GetNodeResponse)(nil), // 10: management.v1.GetNodeResponse + (*CreateNodeInstallTokenRequest)(nil), // 11: management.v1.CreateNodeInstallTokenRequest + (*CreateNodeInstallTokenResponse)(nil), // 12: management.v1.CreateNodeInstallTokenResponse + nil, // 13: management.v1.AddNodeParams.CustomLabelsEntry + nil, // 14: management.v1.RegisterNodeRequest.CustomLabelsEntry + (*UniversalNode_Service)(nil), // 15: management.v1.UniversalNode.Service + (*UniversalNode_Agent)(nil), // 16: management.v1.UniversalNode.Agent + nil, // 17: management.v1.UniversalNode.CustomLabelsEntry + (v1.NodeType)(0), // 18: inventory.v1.NodeType + (MetricsMode)(0), // 19: management.v1.MetricsMode + (*v1.GenericNode)(nil), // 20: inventory.v1.GenericNode + (*v1.ContainerNode)(nil), // 21: inventory.v1.ContainerNode + (*v1.PMMAgent)(nil), // 22: inventory.v1.PMMAgent + (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp + } +) + var file_management_v1_node_proto_depIdxs = []int32{ 18, // 0: management.v1.AddNodeParams.node_type:type_name -> inventory.v1.NodeType 13, // 1: management.v1.AddNodeParams.custom_labels:type_name -> management.v1.AddNodeParams.CustomLabelsEntry diff --git a/api/management/v1/node.swagger.json b/api/management/v1/node.swagger.json deleted file mode 100644 index 87f7e2581d0..00000000000 --- a/api/management/v1/node.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/node.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/management/v1/postgresql.pb.go b/api/management/v1/postgresql.pb.go index d575b00544a..20b9fe29eaf 100644 --- a/api/management/v1/postgresql.pb.go +++ b/api/management/v1/postgresql.pb.go @@ -7,13 +7,15 @@ package managementv1 import ( - _ "github.com/envoyproxy/protoc-gen-validate/validate" - v1 "github.com/percona/pmm/api/inventory/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -505,19 +507,22 @@ func file_management_v1_postgresql_proto_rawDescGZIP() []byte { return file_management_v1_postgresql_proto_rawDescData } -var file_management_v1_postgresql_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_management_v1_postgresql_proto_goTypes = []any{ - (*AddPostgreSQLServiceParams)(nil), // 0: management.v1.AddPostgreSQLServiceParams - (*PostgreSQLServiceResult)(nil), // 1: management.v1.PostgreSQLServiceResult - nil, // 2: management.v1.AddPostgreSQLServiceParams.CustomLabelsEntry - (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams - (MetricsMode)(0), // 4: management.v1.MetricsMode - (v1.LogLevel)(0), // 5: inventory.v1.LogLevel - (*v1.PostgreSQLService)(nil), // 6: inventory.v1.PostgreSQLService - (*v1.PostgresExporter)(nil), // 7: inventory.v1.PostgresExporter - (*v1.QANPostgreSQLPgStatementsAgent)(nil), // 8: inventory.v1.QANPostgreSQLPgStatementsAgent - (*v1.QANPostgreSQLPgStatMonitorAgent)(nil), // 9: inventory.v1.QANPostgreSQLPgStatMonitorAgent -} +var ( + file_management_v1_postgresql_proto_msgTypes = make([]protoimpl.MessageInfo, 3) + file_management_v1_postgresql_proto_goTypes = []any{ + (*AddPostgreSQLServiceParams)(nil), // 0: management.v1.AddPostgreSQLServiceParams + (*PostgreSQLServiceResult)(nil), // 1: management.v1.PostgreSQLServiceResult + nil, // 2: management.v1.AddPostgreSQLServiceParams.CustomLabelsEntry + (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams + (MetricsMode)(0), // 4: management.v1.MetricsMode + (v1.LogLevel)(0), // 5: inventory.v1.LogLevel + (*v1.PostgreSQLService)(nil), // 6: inventory.v1.PostgreSQLService + (*v1.PostgresExporter)(nil), // 7: inventory.v1.PostgresExporter + (*v1.QANPostgreSQLPgStatementsAgent)(nil), // 8: inventory.v1.QANPostgreSQLPgStatementsAgent + (*v1.QANPostgreSQLPgStatMonitorAgent)(nil), // 9: inventory.v1.QANPostgreSQLPgStatMonitorAgent + } +) + var file_management_v1_postgresql_proto_depIdxs = []int32{ 3, // 0: management.v1.AddPostgreSQLServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddPostgreSQLServiceParams.custom_labels:type_name -> management.v1.AddPostgreSQLServiceParams.CustomLabelsEntry diff --git a/api/management/v1/postgresql.swagger.json b/api/management/v1/postgresql.swagger.json deleted file mode 100644 index a4694fd37f7..00000000000 --- a/api/management/v1/postgresql.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/postgresql.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/management/v1/proxysql.pb.go b/api/management/v1/proxysql.pb.go index e9d5678db43..df8c4011336 100644 --- a/api/management/v1/proxysql.pb.go +++ b/api/management/v1/proxysql.pb.go @@ -7,13 +7,15 @@ package managementv1 import ( - _ "github.com/envoyproxy/protoc-gen-validate/validate" - v1 "github.com/percona/pmm/api/inventory/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -367,17 +369,20 @@ func file_management_v1_proxysql_proto_rawDescGZIP() []byte { return file_management_v1_proxysql_proto_rawDescData } -var file_management_v1_proxysql_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_management_v1_proxysql_proto_goTypes = []any{ - (*AddProxySQLServiceParams)(nil), // 0: management.v1.AddProxySQLServiceParams - (*ProxySQLServiceResult)(nil), // 1: management.v1.ProxySQLServiceResult - nil, // 2: management.v1.AddProxySQLServiceParams.CustomLabelsEntry - (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams - (MetricsMode)(0), // 4: management.v1.MetricsMode - (v1.LogLevel)(0), // 5: inventory.v1.LogLevel - (*v1.ProxySQLService)(nil), // 6: inventory.v1.ProxySQLService - (*v1.ProxySQLExporter)(nil), // 7: inventory.v1.ProxySQLExporter -} +var ( + file_management_v1_proxysql_proto_msgTypes = make([]protoimpl.MessageInfo, 3) + file_management_v1_proxysql_proto_goTypes = []any{ + (*AddProxySQLServiceParams)(nil), // 0: management.v1.AddProxySQLServiceParams + (*ProxySQLServiceResult)(nil), // 1: management.v1.ProxySQLServiceResult + nil, // 2: management.v1.AddProxySQLServiceParams.CustomLabelsEntry + (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams + (MetricsMode)(0), // 4: management.v1.MetricsMode + (v1.LogLevel)(0), // 5: inventory.v1.LogLevel + (*v1.ProxySQLService)(nil), // 6: inventory.v1.ProxySQLService + (*v1.ProxySQLExporter)(nil), // 7: inventory.v1.ProxySQLExporter + } +) + var file_management_v1_proxysql_proto_depIdxs = []int32{ 3, // 0: management.v1.AddProxySQLServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddProxySQLServiceParams.custom_labels:type_name -> management.v1.AddProxySQLServiceParams.CustomLabelsEntry diff --git a/api/management/v1/proxysql.swagger.json b/api/management/v1/proxysql.swagger.json deleted file mode 100644 index 64f40cbe45f..00000000000 --- a/api/management/v1/proxysql.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/proxysql.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/management/v1/rds.pb.go b/api/management/v1/rds.pb.go index fd77ebf9cb3..6f8449b00ab 100644 --- a/api/management/v1/rds.pb.go +++ b/api/management/v1/rds.pb.go @@ -7,13 +7,15 @@ package managementv1 import ( - _ "github.com/envoyproxy/protoc-gen-validate/validate" - v1 "github.com/percona/pmm/api/inventory/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -817,26 +819,29 @@ func file_management_v1_rds_proto_rawDescGZIP() []byte { return file_management_v1_rds_proto_rawDescData } -var file_management_v1_rds_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_management_v1_rds_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_management_v1_rds_proto_goTypes = []any{ - (DiscoverRDSEngine)(0), // 0: management.v1.DiscoverRDSEngine - (*DiscoverRDSInstance)(nil), // 1: management.v1.DiscoverRDSInstance - (*DiscoverRDSRequest)(nil), // 2: management.v1.DiscoverRDSRequest - (*DiscoverRDSResponse)(nil), // 3: management.v1.DiscoverRDSResponse - (*AddRDSServiceParams)(nil), // 4: management.v1.AddRDSServiceParams - (*RDSServiceResult)(nil), // 5: management.v1.RDSServiceResult - nil, // 6: management.v1.AddRDSServiceParams.CustomLabelsEntry - (MetricsMode)(0), // 7: management.v1.MetricsMode - (*v1.RemoteRDSNode)(nil), // 8: inventory.v1.RemoteRDSNode - (*v1.RDSExporter)(nil), // 9: inventory.v1.RDSExporter - (*v1.MySQLService)(nil), // 10: inventory.v1.MySQLService - (*v1.MySQLdExporter)(nil), // 11: inventory.v1.MySQLdExporter - (*v1.QANMySQLPerfSchemaAgent)(nil), // 12: inventory.v1.QANMySQLPerfSchemaAgent - (*v1.PostgreSQLService)(nil), // 13: inventory.v1.PostgreSQLService - (*v1.PostgresExporter)(nil), // 14: inventory.v1.PostgresExporter - (*v1.QANPostgreSQLPgStatementsAgent)(nil), // 15: inventory.v1.QANPostgreSQLPgStatementsAgent -} +var ( + file_management_v1_rds_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_management_v1_rds_proto_msgTypes = make([]protoimpl.MessageInfo, 6) + file_management_v1_rds_proto_goTypes = []any{ + (DiscoverRDSEngine)(0), // 0: management.v1.DiscoverRDSEngine + (*DiscoverRDSInstance)(nil), // 1: management.v1.DiscoverRDSInstance + (*DiscoverRDSRequest)(nil), // 2: management.v1.DiscoverRDSRequest + (*DiscoverRDSResponse)(nil), // 3: management.v1.DiscoverRDSResponse + (*AddRDSServiceParams)(nil), // 4: management.v1.AddRDSServiceParams + (*RDSServiceResult)(nil), // 5: management.v1.RDSServiceResult + nil, // 6: management.v1.AddRDSServiceParams.CustomLabelsEntry + (MetricsMode)(0), // 7: management.v1.MetricsMode + (*v1.RemoteRDSNode)(nil), // 8: inventory.v1.RemoteRDSNode + (*v1.RDSExporter)(nil), // 9: inventory.v1.RDSExporter + (*v1.MySQLService)(nil), // 10: inventory.v1.MySQLService + (*v1.MySQLdExporter)(nil), // 11: inventory.v1.MySQLdExporter + (*v1.QANMySQLPerfSchemaAgent)(nil), // 12: inventory.v1.QANMySQLPerfSchemaAgent + (*v1.PostgreSQLService)(nil), // 13: inventory.v1.PostgreSQLService + (*v1.PostgresExporter)(nil), // 14: inventory.v1.PostgresExporter + (*v1.QANPostgreSQLPgStatementsAgent)(nil), // 15: inventory.v1.QANPostgreSQLPgStatementsAgent + } +) + var file_management_v1_rds_proto_depIdxs = []int32{ 0, // 0: management.v1.DiscoverRDSInstance.engine:type_name -> management.v1.DiscoverRDSEngine 1, // 1: management.v1.DiscoverRDSResponse.rds_instances:type_name -> management.v1.DiscoverRDSInstance diff --git a/api/management/v1/rds.swagger.json b/api/management/v1/rds.swagger.json deleted file mode 100644 index a03802476a3..00000000000 --- a/api/management/v1/rds.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/rds.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/management/v1/service.pb.go b/api/management/v1/service.pb.go index 5d462db7731..15d9fce8fae 100644 --- a/api/management/v1/service.pb.go +++ b/api/management/v1/service.pb.go @@ -7,15 +7,17 @@ package managementv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - v1 "github.com/percona/pmm/api/inventory/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -950,60 +952,63 @@ func file_management_v1_service_proto_rawDescGZIP() []byte { return file_management_v1_service_proto_rawDescData } -var file_management_v1_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_management_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_management_v1_service_proto_goTypes = []any{ - (UniversalService_Status)(0), // 0: management.v1.UniversalService.Status - (*AddServiceRequest)(nil), // 1: management.v1.AddServiceRequest - (*AddServiceResponse)(nil), // 2: management.v1.AddServiceResponse - (*RemoveServiceRequest)(nil), // 3: management.v1.RemoveServiceRequest - (*RemoveServiceResponse)(nil), // 4: management.v1.RemoveServiceResponse - (*UniversalService)(nil), // 5: management.v1.UniversalService - (*ListServicesRequest)(nil), // 6: management.v1.ListServicesRequest - (*ListServicesResponse)(nil), // 7: management.v1.ListServicesResponse - nil, // 8: management.v1.UniversalService.CustomLabelsEntry - (*AddMySQLServiceParams)(nil), // 9: management.v1.AddMySQLServiceParams - (*AddMongoDBServiceParams)(nil), // 10: management.v1.AddMongoDBServiceParams - (*AddPostgreSQLServiceParams)(nil), // 11: management.v1.AddPostgreSQLServiceParams - (*AddProxySQLServiceParams)(nil), // 12: management.v1.AddProxySQLServiceParams - (*AddHAProxyServiceParams)(nil), // 13: management.v1.AddHAProxyServiceParams - (*AddExternalServiceParams)(nil), // 14: management.v1.AddExternalServiceParams - (*AddRDSServiceParams)(nil), // 15: management.v1.AddRDSServiceParams - (*AddValkeyServiceParams)(nil), // 16: management.v1.AddValkeyServiceParams - (*MySQLServiceResult)(nil), // 17: management.v1.MySQLServiceResult - (*MongoDBServiceResult)(nil), // 18: management.v1.MongoDBServiceResult - (*PostgreSQLServiceResult)(nil), // 19: management.v1.PostgreSQLServiceResult - (*ProxySQLServiceResult)(nil), // 20: management.v1.ProxySQLServiceResult - (*HAProxyServiceResult)(nil), // 21: management.v1.HAProxyServiceResult - (*ExternalServiceResult)(nil), // 22: management.v1.ExternalServiceResult - (*RDSServiceResult)(nil), // 23: management.v1.RDSServiceResult - (*ValkeyServiceResult)(nil), // 24: management.v1.ValkeyServiceResult - (v1.ServiceType)(0), // 25: inventory.v1.ServiceType - (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp - (*UniversalAgent)(nil), // 27: management.v1.UniversalAgent - (*AddAnnotationRequest)(nil), // 28: management.v1.AddAnnotationRequest - (*ListAgentsRequest)(nil), // 29: management.v1.ListAgentsRequest - (*ListAgentVersionsRequest)(nil), // 30: management.v1.ListAgentVersionsRequest - (*RegisterNodeRequest)(nil), // 31: management.v1.RegisterNodeRequest - (*UnregisterNodeRequest)(nil), // 32: management.v1.UnregisterNodeRequest - (*ListNodesRequest)(nil), // 33: management.v1.ListNodesRequest - (*GetNodeRequest)(nil), // 34: management.v1.GetNodeRequest - (*CreateNodeInstallTokenRequest)(nil), // 35: management.v1.CreateNodeInstallTokenRequest - (*DiscoverRDSRequest)(nil), // 36: management.v1.DiscoverRDSRequest - (*DiscoverAzureDatabaseRequest)(nil), // 37: management.v1.DiscoverAzureDatabaseRequest - (*AddAzureDatabaseRequest)(nil), // 38: management.v1.AddAzureDatabaseRequest - (*AddAnnotationResponse)(nil), // 39: management.v1.AddAnnotationResponse - (*ListAgentsResponse)(nil), // 40: management.v1.ListAgentsResponse - (*ListAgentVersionsResponse)(nil), // 41: management.v1.ListAgentVersionsResponse - (*RegisterNodeResponse)(nil), // 42: management.v1.RegisterNodeResponse - (*UnregisterNodeResponse)(nil), // 43: management.v1.UnregisterNodeResponse - (*ListNodesResponse)(nil), // 44: management.v1.ListNodesResponse - (*GetNodeResponse)(nil), // 45: management.v1.GetNodeResponse - (*CreateNodeInstallTokenResponse)(nil), // 46: management.v1.CreateNodeInstallTokenResponse - (*DiscoverRDSResponse)(nil), // 47: management.v1.DiscoverRDSResponse - (*DiscoverAzureDatabaseResponse)(nil), // 48: management.v1.DiscoverAzureDatabaseResponse - (*AddAzureDatabaseResponse)(nil), // 49: management.v1.AddAzureDatabaseResponse -} +var ( + file_management_v1_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_management_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) + file_management_v1_service_proto_goTypes = []any{ + (UniversalService_Status)(0), // 0: management.v1.UniversalService.Status + (*AddServiceRequest)(nil), // 1: management.v1.AddServiceRequest + (*AddServiceResponse)(nil), // 2: management.v1.AddServiceResponse + (*RemoveServiceRequest)(nil), // 3: management.v1.RemoveServiceRequest + (*RemoveServiceResponse)(nil), // 4: management.v1.RemoveServiceResponse + (*UniversalService)(nil), // 5: management.v1.UniversalService + (*ListServicesRequest)(nil), // 6: management.v1.ListServicesRequest + (*ListServicesResponse)(nil), // 7: management.v1.ListServicesResponse + nil, // 8: management.v1.UniversalService.CustomLabelsEntry + (*AddMySQLServiceParams)(nil), // 9: management.v1.AddMySQLServiceParams + (*AddMongoDBServiceParams)(nil), // 10: management.v1.AddMongoDBServiceParams + (*AddPostgreSQLServiceParams)(nil), // 11: management.v1.AddPostgreSQLServiceParams + (*AddProxySQLServiceParams)(nil), // 12: management.v1.AddProxySQLServiceParams + (*AddHAProxyServiceParams)(nil), // 13: management.v1.AddHAProxyServiceParams + (*AddExternalServiceParams)(nil), // 14: management.v1.AddExternalServiceParams + (*AddRDSServiceParams)(nil), // 15: management.v1.AddRDSServiceParams + (*AddValkeyServiceParams)(nil), // 16: management.v1.AddValkeyServiceParams + (*MySQLServiceResult)(nil), // 17: management.v1.MySQLServiceResult + (*MongoDBServiceResult)(nil), // 18: management.v1.MongoDBServiceResult + (*PostgreSQLServiceResult)(nil), // 19: management.v1.PostgreSQLServiceResult + (*ProxySQLServiceResult)(nil), // 20: management.v1.ProxySQLServiceResult + (*HAProxyServiceResult)(nil), // 21: management.v1.HAProxyServiceResult + (*ExternalServiceResult)(nil), // 22: management.v1.ExternalServiceResult + (*RDSServiceResult)(nil), // 23: management.v1.RDSServiceResult + (*ValkeyServiceResult)(nil), // 24: management.v1.ValkeyServiceResult + (v1.ServiceType)(0), // 25: inventory.v1.ServiceType + (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp + (*UniversalAgent)(nil), // 27: management.v1.UniversalAgent + (*AddAnnotationRequest)(nil), // 28: management.v1.AddAnnotationRequest + (*ListAgentsRequest)(nil), // 29: management.v1.ListAgentsRequest + (*ListAgentVersionsRequest)(nil), // 30: management.v1.ListAgentVersionsRequest + (*RegisterNodeRequest)(nil), // 31: management.v1.RegisterNodeRequest + (*UnregisterNodeRequest)(nil), // 32: management.v1.UnregisterNodeRequest + (*ListNodesRequest)(nil), // 33: management.v1.ListNodesRequest + (*GetNodeRequest)(nil), // 34: management.v1.GetNodeRequest + (*CreateNodeInstallTokenRequest)(nil), // 35: management.v1.CreateNodeInstallTokenRequest + (*DiscoverRDSRequest)(nil), // 36: management.v1.DiscoverRDSRequest + (*DiscoverAzureDatabaseRequest)(nil), // 37: management.v1.DiscoverAzureDatabaseRequest + (*AddAzureDatabaseRequest)(nil), // 38: management.v1.AddAzureDatabaseRequest + (*AddAnnotationResponse)(nil), // 39: management.v1.AddAnnotationResponse + (*ListAgentsResponse)(nil), // 40: management.v1.ListAgentsResponse + (*ListAgentVersionsResponse)(nil), // 41: management.v1.ListAgentVersionsResponse + (*RegisterNodeResponse)(nil), // 42: management.v1.RegisterNodeResponse + (*UnregisterNodeResponse)(nil), // 43: management.v1.UnregisterNodeResponse + (*ListNodesResponse)(nil), // 44: management.v1.ListNodesResponse + (*GetNodeResponse)(nil), // 45: management.v1.GetNodeResponse + (*CreateNodeInstallTokenResponse)(nil), // 46: management.v1.CreateNodeInstallTokenResponse + (*DiscoverRDSResponse)(nil), // 47: management.v1.DiscoverRDSResponse + (*DiscoverAzureDatabaseResponse)(nil), // 48: management.v1.DiscoverAzureDatabaseResponse + (*AddAzureDatabaseResponse)(nil), // 49: management.v1.AddAzureDatabaseResponse + } +) + var file_management_v1_service_proto_depIdxs = []int32{ 9, // 0: management.v1.AddServiceRequest.mysql:type_name -> management.v1.AddMySQLServiceParams 10, // 1: management.v1.AddServiceRequest.mongodb:type_name -> management.v1.AddMongoDBServiceParams diff --git a/api/management/v1/service.swagger.json b/api/management/v1/service.swagger.json deleted file mode 100644 index 8e3860812b9..00000000000 --- a/api/management/v1/service.swagger.json +++ /dev/null @@ -1,4565 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/service.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "ManagementService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/management/agents": { - "get": { - "summary": "List Agents", - "description": "Lists Agents with filter.", - "operationId": "ListAgents", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListAgentsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "service_id", - "description": "Return only Agents that relate to a specific ServiceID.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "node_id", - "description": "Return only Agents that relate to a specific NodeID.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "ManagementService" - ] - } - }, - "/v1/management/agents/versions": { - "get": { - "summary": "List Agent Versions", - "description": "Lists Agent versions and their update severity.", - "operationId": "ListAgentVersions", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListAgentVersionsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "tags": [ - "ManagementService" - ] - } - }, - "/v1/management/annotations": { - "post": { - "summary": "Add an Annotation", - "description": "Adds an annotation.", - "operationId": "AddAnnotation", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1AddAnnotationResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "AddAnnotationRequest is a params to add new annotation.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1AddAnnotationRequest" - } - } - ], - "tags": [ - "ManagementService" - ] - } - }, - "/v1/management/nodes": { - "get": { - "summary": "List Nodes", - "description": "Lists Nodes with filter.", - "operationId": "ListNodes", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListNodesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "node_type", - "description": "Node type to be filtered out.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ], - "default": "NODE_TYPE_UNSPECIFIED" - } - ], - "tags": [ - "ManagementService" - ] - }, - "post": { - "summary": "Register a Node", - "description": "Registers a new Node and a pmm-agent.", - "operationId": "RegisterNode", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1RegisterNodeResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1RegisterNodeRequest" - } - } - ], - "tags": [ - "ManagementService" - ] - } - }, - "/v1/management/nodes/{node_id}": { - "get": { - "summary": "Get Node", - "description": "Gets a single Node by ID.", - "operationId": "GetNode", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetNodeResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "node_id", - "description": "Unique Node identifier.", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "ManagementService" - ] - }, - "delete": { - "summary": "Unregister a Node", - "description": "Unregisters a Node and pmm-agent", - "operationId": "UnregisterNode", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UnregisterNodeResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "node_id", - "description": "Node_id to be unregistered.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "force", - "description": "Force delete node, related service account, even if it has more service tokens attached.", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "tags": [ - "ManagementService" - ] - } - }, - "/v1/management/nodes:installToken": { - "post": { - "summary": "Create Node Install Token", - "description": "Creates a short-lived Grafana service account token for PMM Client install.", - "operationId": "CreateNodeInstallToken", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1CreateNodeInstallTokenResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1CreateNodeInstallTokenRequest" - } - } - ], - "tags": [ - "ManagementService" - ] - } - }, - "/v1/management/services": { - "get": { - "summary": "List Services", - "description": "Returns a filtered list of Services.", - "operationId": "ListServices", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListServicesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "node_id", - "description": "Return only Services running on that Node.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "service_type", - "description": "Return only services filtered by service type.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "SERVICE_TYPE_UNSPECIFIED", - "SERVICE_TYPE_MYSQL_SERVICE", - "SERVICE_TYPE_MONGODB_SERVICE", - "SERVICE_TYPE_POSTGRESQL_SERVICE", - "SERVICE_TYPE_VALKEY_SERVICE", - "SERVICE_TYPE_PROXYSQL_SERVICE", - "SERVICE_TYPE_HAPROXY_SERVICE", - "SERVICE_TYPE_EXTERNAL_SERVICE" - ], - "default": "SERVICE_TYPE_UNSPECIFIED" - }, - { - "name": "external_group", - "description": "Return only services in this external group.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "ManagementService" - ] - }, - "post": { - "summary": "Add a Service", - "description": "Adds a service and starts several agents.", - "operationId": "AddService", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1AddServiceResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1AddServiceRequest" - } - } - ], - "tags": [ - "ManagementService" - ] - } - }, - "/v1/management/services/azure": { - "post": { - "summary": "Add Azure Database", - "description": "Adds an Azure Database instance.", - "operationId": "AddAzureDatabase", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1AddAzureDatabaseResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1AddAzureDatabaseRequest" - } - } - ], - "tags": [ - "ManagementService" - ] - } - }, - "/v1/management/services/{service_id}": { - "delete": { - "summary": "Remove a Service", - "description": "Removes a Service along with its Agents.", - "operationId": "RemoveService", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1RemoveServiceResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "service_id", - "description": "Either a Service ID or a Service Name.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "service_type", - "description": "Service type.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "SERVICE_TYPE_UNSPECIFIED", - "SERVICE_TYPE_MYSQL_SERVICE", - "SERVICE_TYPE_MONGODB_SERVICE", - "SERVICE_TYPE_POSTGRESQL_SERVICE", - "SERVICE_TYPE_VALKEY_SERVICE", - "SERVICE_TYPE_PROXYSQL_SERVICE", - "SERVICE_TYPE_HAPROXY_SERVICE", - "SERVICE_TYPE_EXTERNAL_SERVICE" - ], - "default": "SERVICE_TYPE_UNSPECIFIED" - } - ], - "tags": [ - "ManagementService" - ] - } - }, - "/v1/management/services:discoverAzure": { - "post": { - "summary": "Discover Azure Database", - "description": "Discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances.", - "operationId": "DiscoverAzureDatabase", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1DiscoverAzureDatabaseResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "DiscoverAzureDatabaseRequest discover azure databases request.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1DiscoverAzureDatabaseRequest" - } - } - ], - "tags": [ - "ManagementService" - ] - } - }, - "/v1/management/services:discoverRDS": { - "post": { - "summary": "Discover RDS", - "description": "Discovers RDS instances.", - "operationId": "DiscoverRDS", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1DiscoverRDSResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/googleRpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1DiscoverRDSRequest" - } - } - ], - "tags": [ - "ManagementService" - ] - } - } - }, - "definitions": { - "UniversalAgentAzureOptions": { - "type": "object", - "properties": { - "client_id": { - "type": "string", - "description": "Azure client ID." - }, - "is_client_secret_set": { - "type": "boolean", - "description": "True if Azure client secret is set." - }, - "resource_group": { - "type": "string", - "description": "Azure resource group." - }, - "subscription_id": { - "type": "string", - "description": "Azure subscription ID." - }, - "tenant_id": { - "type": "string", - "description": "Azure tenant ID." - } - } - }, - "UniversalAgentMongoDBOptions": { - "type": "object", - "properties": { - "is_tls_certificate_key_set": { - "type": "boolean", - "description": "True if TLS certificate is set." - }, - "is_tls_certificate_key_file_password_set": { - "type": "boolean", - "description": "True if TLS certificate file password is set." - }, - "authentication_mechanism": { - "type": "string", - "description": "MongoDB auth mechanism." - }, - "authentication_database": { - "type": "string", - "description": "MongoDB auth database." - }, - "stats_collections": { - "type": "array", - "items": { - "type": "string" - }, - "description": "MongoDB stats collections." - }, - "collections_limit": { - "type": "integer", - "format": "int32", - "description": "MongoDB collections limit." - }, - "enable_all_collectors": { - "type": "boolean", - "description": "True if all collectors are enabled." - } - } - }, - "UniversalAgentMySQLOptions": { - "type": "object", - "properties": { - "is_tls_key_set": { - "type": "boolean", - "description": "True if TLS key is set." - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra DSN parameters for MySQL connection." - } - } - }, - "UniversalAgentPostgreSQLOptions": { - "type": "object", - "properties": { - "is_ssl_key_set": { - "type": "boolean", - "description": "True if TLS key is set." - }, - "auto_discovery_limit": { - "type": "integer", - "format": "int32", - "description": "Limit of databases for auto-discovery." - }, - "max_exporter_connections": { - "type": "integer", - "format": "int32", - "description": "Maximum number of connections from exporter to PostgreSQL instance." - } - } - }, - "UniversalAgentValkeyOptions": { - "type": "object" - }, - "UniversalNodeAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique Agent identifier." - }, - "agent_type": { - "type": "string", - "description": "Agent type." - }, - "status": { - "type": "string", - "description": "Actual Agent status." - }, - "is_connected": { - "type": "boolean", - "description": "True if Agent is running and connected to pmm-managed." - } - } - }, - "UniversalNodeService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique Service identifier." - }, - "service_type": { - "type": "string", - "description": "Service type." - }, - "service_name": { - "type": "string", - "description": "Service name." - } - }, - "description": "Service represents a service running on a node." - }, - "commonMetricsResolutions": { - "type": "object", - "properties": { - "hr": { - "type": "string", - "description": "High resolution. In JSON should be represented as a string with number of seconds with `s` suffix." - }, - "mr": { - "type": "string", - "description": "Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix." - }, - "lr": { - "type": "string", - "description": "Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix." - } - }, - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions." - }, - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "v1AddAnnotationRequest": { - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "An annotation description. Required." - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Tags are used to filter annotations." - }, - "node_name": { - "type": "string", - "description": "Used for annotating a node." - }, - "service_names": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Used for annotating services." - } - }, - "description": "AddAnnotationRequest is a params to add new annotation." - }, - "v1AddAnnotationResponse": { - "type": "object" - }, - "v1AddAzureDatabaseRequest": { - "type": "object", - "properties": { - "region": { - "type": "string", - "description": "Azure database location." - }, - "az": { - "type": "string", - "description": "Azure database availability zone." - }, - "instance_id": { - "type": "string", - "description": "Azure database instance ID." - }, - "node_model": { - "type": "string", - "description": "Represents a purchasable Stock Keeping Unit (SKU) under a product.\nhttps://docs.microsoft.com/en-us/partner-center/develop/product-resources#sku." - }, - "address": { - "type": "string", - "description": "Address used to connect to it." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port." - }, - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name. Defaults to Azure Database instance ID." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Defaults to Azure Database instance ID." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "username": { - "type": "string", - "description": "Username for scraping metrics." - }, - "password": { - "type": "string", - "description": "Password for scraping metrics." - }, - "azure_client_id": { - "type": "string", - "description": "Azure client ID." - }, - "azure_client_secret": { - "type": "string", - "description": "Azure client secret." - }, - "azure_tenant_id": { - "type": "string", - "description": "Azure tanant ID." - }, - "azure_subscription_id": { - "type": "string", - "description": "Azure subscription ID." - }, - "azure_resource_group": { - "type": "string", - "description": "Azure resource group." - }, - "azure_database_exporter": { - "type": "boolean", - "description": "If true, adds azure_database_exporter." - }, - "qan": { - "type": "boolean", - "description": "If true, adds qan-mysql-perfschema-agent or qan-postgresql-pgstatements-agent." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels for Node and Service." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "disable_query_examples": { - "type": "boolean", - "description": "Disable query examples." - }, - "tablestats_group_table_limit": { - "type": "integer", - "format": "int32", - "description": "Tablestats group collectors will be disabled if there are more than that number of tables.\nIf zero, server's default value is used.\nUse negative value to disable them." - }, - "type": { - "$ref": "#/definitions/v1DiscoverAzureDatabaseType", - "title": "Azure database resource type (mysql, maria, postgres)" - } - } - }, - "v1AddAzureDatabaseResponse": { - "type": "object" - }, - "v1AddExternalServiceParams": { - "type": "object", - "properties": { - "runs_on_node_id": { - "type": "string", - "description": "Node identifier on which an external exporter is been running.\nruns_on_node_id should always be passed with node_id.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "node_name": { - "type": "string", - "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "add_node": { - "$ref": "#/definitions/v1AddNodeParams", - "description": "Create a new Node with those parameters.\nadd_node should always be passed with address.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "address": { - "type": "string", - "description": "Node and Exporter access address (DNS name or IP).\naddress should always be passed with add_node." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Required." - }, - "username": { - "type": "string", - "description": "HTTP basic auth username for collecting metrics." - }, - "password": { - "type": "string", - "description": "HTTP basic auth password for collecting metrics." - }, - "scheme": { - "type": "string", - "description": "Scheme to generate URI to exporter metrics endpoints." - }, - "metrics_path": { - "type": "string", - "description": "Path under which metrics are exposed, used to generate URI." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "node_id": { - "type": "string", - "description": "Node identifier on which an external service is been running.\nnode_id should always be passed with runs_on_node_id." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels for Service." - }, - "group": { - "type": "string", - "description": "Group name of external service." - }, - "metrics_mode": { - "$ref": "#/definitions/v1MetricsMode", - "description": "Defines metrics flow model for this exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically.\nNode with registered pmm_agent_id must present at pmm-server\nin case of push metrics_mode." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - } - } - }, - "v1AddHAProxyServiceParams": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Node identifier on which an external exporter is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "node_name": { - "type": "string", - "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "add_node": { - "$ref": "#/definitions/v1AddNodeParams", - "description": "Create a new Node with those parameters.\nadd_node always should be passed with address.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "address": { - "type": "string", - "description": "Node and Exporter access address (DNS name or IP).\naddress always should be passed with add_node." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Required." - }, - "username": { - "type": "string", - "description": "HTTP basic auth username for collecting metrics." - }, - "password": { - "type": "string", - "description": "HTTP basic auth password for collecting metrics." - }, - "scheme": { - "type": "string", - "description": "Scheme to generate URI to exporter metrics endpoints." - }, - "metrics_path": { - "type": "string", - "description": "Path under which metrics are exposed, used to generate URI." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels for Service." - }, - "metrics_mode": { - "$ref": "#/definitions/v1MetricsMode", - "description": "Defines metrics flow model for this exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically.\nNode with registered pmm_agent_id must present at pmm-server\nin case of push metrics_mode." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - } - } - }, - "v1AddMongoDBServiceParams": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "node_name": { - "type": "string", - "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "add_node": { - "$ref": "#/definitions/v1AddNodeParams", - "description": "Create a new Node with those parameters.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Required." - }, - "address": { - "type": "string", - "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Service Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Service Access socket.\nAddress (and port) or socket is required." - }, - "pmm_agent_id": { - "type": "string", - "description": "The \"pmm-agent\" identifier which should run agents. Required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "username": { - "type": "string", - "description": "MongoDB username for exporter and QAN agent access." - }, - "password": { - "type": "string", - "description": "MongoDB password for exporter and QAN agent access." - }, - "qan_mongodb_profiler": { - "type": "boolean", - "description": "If true, adds qan-mongodb-profiler-agent for provided service." - }, - "qan_mongodb_mongolog": { - "type": "boolean", - "description": "If true, adds qan-mongodb-mongolog-agent for provided service." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels for Service." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_certificate_key": { - "type": "string", - "description": "Client certificate and key." - }, - "tls_certificate_key_file_password": { - "type": "string", - "description": "Password for decrypting tls_certificate_key." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "metrics_mode": { - "$ref": "#/definitions/v1MetricsMode", - "description": "Defines metrics flow model for this exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "authentication_mechanism": { - "type": "string", - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details." - }, - "authentication_database": { - "type": "string", - "description": "Authentication database." - }, - "agent_password": { - "type": "string", - "description": "Custom password for exporter endpoint /metrics." - }, - "stats_collections": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collections to get stats from. Can use * ." - }, - "collections_limit": { - "type": "integer", - "format": "int32", - "title": "Collections limit. Only get Databases and collection stats if the total number of collections in the server\nis less than this value. 0: no limit" - }, - "enable_all_collectors": { - "type": "boolean", - "title": "Enable all collectors" - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "title": "Exporter log level" - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "environment_variable_names": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Environment variable names to pass to the exporter.\nValues will be resolved from pmm-agent's environment when starting the exporter." - }, - "rta_mongodb_agent": { - "type": "boolean", - "description": "If true, adds Real-Time Analytics agent for the provided service." - } - } - }, - "v1AddMySQLServiceParams": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "node_name": { - "type": "string", - "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "add_node": { - "$ref": "#/definitions/v1AddNodeParams", - "description": "Create a new Node with those parameters.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Required." - }, - "address": { - "type": "string", - "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Service Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Service Access socket.\nAddress (and port) or socket is required." - }, - "pmm_agent_id": { - "type": "string", - "description": "The \"pmm-agent\" identifier which should run agents. Required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "username": { - "type": "string", - "description": "MySQL username for scraping metrics." - }, - "password": { - "type": "string", - "description": "MySQL password for scraping metrics." - }, - "qan_mysql_perfschema": { - "type": "boolean", - "description": "If true, adds qan-mysql-perfschema-agent for provided service." - }, - "qan_mysql_slowlog": { - "type": "boolean", - "description": "If true, adds qan-mysql-slowlog-agent for provided service." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels for Service." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "disable_query_examples": { - "type": "boolean", - "description": "Disable query examples." - }, - "max_slowlog_file_size": { - "type": "string", - "format": "int64", - "description": "If qan-mysql-slowlog-agent is added, slowlog file is rotated at this size if \u003e 0.\nIf zero, server's default value is used.\nUse negative value to disable rotation." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "tls_cert": { - "type": "string", - "description": "Client certificate." - }, - "tls_key": { - "type": "string", - "description": "Password for decrypting tls_cert." - }, - "tablestats_group_table_limit": { - "type": "integer", - "format": "int32", - "description": "Tablestats group collectors will be disabled if there are more than that number of tables.\nIf zero, server's default value is used.\nUse negative value to disable them." - }, - "metrics_mode": { - "$ref": "#/definitions/v1MetricsMode", - "description": "Defines metrics flow model for this exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "agent_password": { - "type": "string", - "description": "Custom password for exporter endpoint /metrics." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "title": "Exporter log level" - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "extra DSN parameters to be used for connecting to MySQL." - } - } - }, - "v1AddNodeParams": { - "type": "object", - "properties": { - "node_type": { - "$ref": "#/definitions/v1NodeType", - "description": "Node type to be registered." - }, - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "machine_id": { - "type": "string", - "description": "Linux machine-id." - }, - "distro": { - "type": "string", - "description": "Linux distribution name and version." - }, - "container_id": { - "type": "string", - "description": "Container identifier. If specified, must be a unique Docker container identifier." - }, - "container_name": { - "type": "string", - "description": "Container name." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels for Node." - } - }, - "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service." - }, - "v1AddPostgreSQLServiceParams": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "node_name": { - "type": "string", - "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "add_node": { - "$ref": "#/definitions/v1AddNodeParams", - "description": "Create a new Node with those parameters.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Required." - }, - "address": { - "type": "string", - "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Service Access port.\nPort is required when the address present." - }, - "database": { - "type": "string", - "description": "Database name." - }, - "socket": { - "type": "string", - "description": "Service Access socket.\nAddress (and port) or socket is required." - }, - "pmm_agent_id": { - "type": "string", - "description": "The \"pmm-agent\" identifier which should run agents. Required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "username": { - "type": "string", - "description": "PostgreSQL username for scraping metrics." - }, - "password": { - "type": "string", - "description": "PostgreSQL password for scraping metrics." - }, - "qan_postgresql_pgstatements_agent": { - "type": "boolean", - "description": "If true, adds qan-postgresql-pgstatements-agent for provided service." - }, - "qan_postgresql_pgstatmonitor_agent": { - "type": "boolean", - "description": "If true, adds qan-postgresql-pgstatmonitor-agent for provided service." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "disable_query_examples": { - "type": "boolean", - "description": "Disable query examples." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels for Service." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full." - }, - "metrics_mode": { - "$ref": "#/definitions/v1MetricsMode", - "description": "Defines metrics flow model for this exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "tls_ca": { - "type": "string", - "description": "TLS CA certificate." - }, - "tls_cert": { - "type": "string", - "description": "TLS Certifcate." - }, - "tls_key": { - "type": "string", - "description": "TLS Certificate Key." - }, - "agent_password": { - "type": "string", - "description": "Custom password for exporter endpoint /metrics." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "title": "Exporter log level" - }, - "auto_discovery_limit": { - "type": "integer", - "format": "int32", - "description": "Limit for auto discovery." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "max_exporter_connections": { - "type": "integer", - "format": "int32", - "description": "Maximum number of connections that exporter can open to the database instance." - } - } - }, - "v1AddProxySQLServiceParams": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "node_name": { - "type": "string", - "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "add_node": { - "$ref": "#/definitions/v1AddNodeParams", - "description": "Create a new Node with those parameters.\nExactly one of these parameters should be present: node_id, node_name, add_node." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Required." - }, - "address": { - "type": "string", - "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Service Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Service Access socket.\nAddress (and port) or socket is required." - }, - "pmm_agent_id": { - "type": "string", - "description": "The \"pmm-agent\" identifier which should run agents. Required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "username": { - "type": "string", - "description": "ProxySQL username for scraping metrics." - }, - "password": { - "type": "string", - "description": "ProxySQL password for scraping metrics." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels for Service." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "metrics_mode": { - "$ref": "#/definitions/v1MetricsMode", - "description": "Defines metrics flow model for this exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "agent_password": { - "type": "string", - "description": "Custom password for exporter endpoint /metrics." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "title": "Exporter log level" - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - } - } - }, - "v1AddRDSServiceParams": { - "type": "object", - "properties": { - "region": { - "type": "string", - "description": "AWS region." - }, - "az": { - "type": "string", - "description": "AWS availability zone." - }, - "instance_id": { - "type": "string", - "description": "AWS instance ID." - }, - "node_model": { - "type": "string", - "description": "AWS instance class." - }, - "address": { - "type": "string", - "description": "Address used to connect to it." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port." - }, - "engine": { - "$ref": "#/definitions/v1DiscoverRDSEngine", - "description": "Instance engine." - }, - "pmm_agent_id": { - "type": "string", - "description": "PMM Agent ID." - }, - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name. Defaults to AWS instance ID." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name. Defaults to AWS instance ID." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "username": { - "type": "string", - "description": "Username for scraping metrics." - }, - "password": { - "type": "string", - "description": "Password for scraping metrics." - }, - "aws_access_key": { - "type": "string", - "description": "AWS Access key." - }, - "aws_secret_key": { - "type": "string", - "description": "AWS Secret key." - }, - "rds_exporter": { - "type": "boolean", - "description": "If true, adds rds_exporter." - }, - "qan_mysql_perfschema": { - "type": "boolean", - "description": "If true, adds qan-mysql-perfschema-agent." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels for Node and Service." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "disable_query_examples": { - "type": "boolean", - "description": "Disable query examples." - }, - "tablestats_group_table_limit": { - "type": "integer", - "format": "int32", - "description": "Tablestats group collectors will be disabled if there are more than that number of tables.\nIf zero, server's default value is used.\nUse negative value to disable them." - }, - "disable_basic_metrics": { - "type": "boolean", - "description": "Disable basic metrics." - }, - "disable_enhanced_metrics": { - "type": "boolean", - "description": "Disable enhanced metrics." - }, - "metrics_mode": { - "$ref": "#/definitions/v1MetricsMode", - "description": "Defines metrics flow model for this exporter.\nPush metrics mode is not allowed." - }, - "qan_postgresql_pgstatements": { - "type": "boolean", - "title": "If true, add qan-pgstatements" - }, - "agent_password": { - "type": "string", - "description": "Custom password for exporter endpoint /metrics." - }, - "database": { - "type": "string", - "description": "Database name." - }, - "auto_discovery_limit": { - "type": "integer", - "format": "int32", - "description": "Limit of databases for auto-discovery." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "max_postgresql_exporter_connections": { - "type": "integer", - "format": "int32", - "description": "Maximum number of exporter connections to PostgreSQL instance." - } - } - }, - "v1AddServiceRequest": { - "type": "object", - "properties": { - "mysql": { - "$ref": "#/definitions/v1AddMySQLServiceParams" - }, - "mongodb": { - "$ref": "#/definitions/v1AddMongoDBServiceParams" - }, - "postgresql": { - "$ref": "#/definitions/v1AddPostgreSQLServiceParams" - }, - "proxysql": { - "$ref": "#/definitions/v1AddProxySQLServiceParams" - }, - "haproxy": { - "$ref": "#/definitions/v1AddHAProxyServiceParams" - }, - "external": { - "$ref": "#/definitions/v1AddExternalServiceParams" - }, - "rds": { - "$ref": "#/definitions/v1AddRDSServiceParams" - }, - "valkey": { - "$ref": "#/definitions/v1AddValkeyServiceParams" - } - } - }, - "v1AddServiceResponse": { - "type": "object", - "properties": { - "mysql": { - "$ref": "#/definitions/v1MySQLServiceResult" - }, - "mongodb": { - "$ref": "#/definitions/v1MongoDBServiceResult" - }, - "postgresql": { - "$ref": "#/definitions/v1PostgreSQLServiceResult" - }, - "proxysql": { - "$ref": "#/definitions/v1ProxySQLServiceResult" - }, - "haproxy": { - "$ref": "#/definitions/v1HAProxyServiceResult" - }, - "external": { - "$ref": "#/definitions/v1ExternalServiceResult" - }, - "rds": { - "$ref": "#/definitions/v1RDSServiceResult" - }, - "valkey": { - "$ref": "#/definitions/v1ValkeyServiceResult" - } - } - }, - "v1AddValkeyServiceParams": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Node identifier on which the service is running.\nOnly one of these parameters should be present: node_id, node_name, add_node." - }, - "node_name": { - "type": "string", - "description": "Node name on which a service is running.\nOnly one of these parameters should be present: node_id, node_name, add_node." - }, - "add_node": { - "$ref": "#/definitions/v1AddNodeParams", - "description": "Create a new Node with those parameters.\nOnly one of these parameters should be present: node_id, node_name, add_node." - }, - "service_name": { - "type": "string", - "description": "User-defined name, it is required and should be unique across all services." - }, - "address": { - "type": "string", - "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Service access port.\nPort is required when the address is present." - }, - "socket": { - "type": "string", - "description": "Service access socket.\nAddress (and port) or socket is required." - }, - "pmm_agent_id": { - "type": "string", - "description": "The \"pmm-agent\" identifier which should run agents. Required." - }, - "username": { - "type": "string", - "description": "Valkey username for scraping metrics." - }, - "password": { - "type": "string", - "description": "Valkey password for scraping metrics." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels for Service." - }, - "skip_connection_check": { - "type": "boolean", - "description": "Skip connection check." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for connection." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS verification." - }, - "metrics_mode": { - "$ref": "#/definitions/v1MetricsMode", - "description": "Defines metrics flow model for the Valkey exporter.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "title": "Exporter log level" - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "tls_ca": { - "type": "string", - "description": "TLS CA certificate." - }, - "tls_cert": { - "type": "string", - "description": "TLS Certifcate." - }, - "tls_key": { - "type": "string", - "description": "TLS Certificate Key." - }, - "agent_password": { - "type": "string", - "description": "Custom password for exporter endpoint /metrics." - } - } - }, - "v1AgentStatus": { - "type": "string", - "enum": [ - "AGENT_STATUS_UNSPECIFIED", - "AGENT_STATUS_STARTING", - "AGENT_STATUS_INITIALIZATION_ERROR", - "AGENT_STATUS_RUNNING", - "AGENT_STATUS_WAITING", - "AGENT_STATUS_STOPPING", - "AGENT_STATUS_DONE", - "AGENT_STATUS_UNKNOWN" - ], - "default": "AGENT_STATUS_UNSPECIFIED", - "description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent has been stopped or disabled.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state." - }, - "v1AgentVersions": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Agent ID." - }, - "version": { - "type": "string", - "description": "Agent version." - }, - "node_name": { - "type": "string", - "description": "Node name where the agent runs." - }, - "severity": { - "$ref": "#/definitions/v1UpdateSeverity", - "description": "Update severity." - } - } - }, - "v1ContainerNode": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "address": { - "type": "string", - "description": "Node address (DNS name or IP)." - }, - "machine_id": { - "type": "string", - "description": "Linux machine-id of the Generic Node where this Container Node runs." - }, - "container_id": { - "type": "string", - "description": "Container identifier. If specified, must be a unique Docker container identifier." - }, - "container_name": { - "type": "string", - "description": "Container name." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "is_pmm_server_node": { - "type": "boolean", - "description": "True if this node is a PMM Server node (HA mode)." - } - }, - "description": "ContainerNode represents a Docker container." - }, - "v1CreateNodeInstallTokenRequest": { - "type": "object", - "properties": { - "ttl_seconds": { - "type": "integer", - "format": "int64", - "description": "Token TTL in seconds; 0 means use server default. Server clamps to a maximum." - }, - "technology": { - "type": "string", - "description": "Technology for install script TECH env (e.g. mysql, postgresql, mongodb)." - } - }, - "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash)." - }, - "v1CreateNodeInstallTokenResponse": { - "type": "object", - "properties": { - "token": { - "type": "string", - "description": "Plaintext token for PMM_SERVER_URL userinfo (service_token:\u003ctoken\u003e)." - }, - "expires_at": { - "type": "string", - "format": "date-time", - "description": "Expiration time of the token (derived from TTL)." - }, - "service_account_id": { - "type": "string", - "format": "int64", - "description": "Grafana service account id created for this install token flow." - } - }, - "description": "CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL." - }, - "v1DiscoverAzureDatabaseInstance": { - "type": "object", - "properties": { - "instance_id": { - "type": "string", - "description": "Azure database instance ID." - }, - "region": { - "type": "string", - "description": "Azure database location." - }, - "service_name": { - "type": "string", - "description": "Azure database server name." - }, - "username": { - "type": "string", - "description": "Database username." - }, - "address": { - "type": "string", - "description": "Address used to connect to it." - }, - "azure_resource_group": { - "type": "string", - "description": "Azure Resource group." - }, - "environment": { - "type": "string", - "description": "Environment tag." - }, - "type": { - "$ref": "#/definitions/v1DiscoverAzureDatabaseType", - "description": "Database type." - }, - "az": { - "type": "string", - "description": "Azure database availability zone." - }, - "node_model": { - "type": "string", - "description": "Represents a purchasable Stock Keeping Unit (SKU) under a product.\nhttps://docs.microsoft.com/en-us/partner-center/develop/product-resources#sku." - } - }, - "description": "DiscoverAzureDatabaseInstance models an unique Azure Database instance for the list of instances returned by Discovery." - }, - "v1DiscoverAzureDatabaseRequest": { - "type": "object", - "properties": { - "azure_client_id": { - "type": "string", - "description": "Azure client ID." - }, - "azure_client_secret": { - "type": "string", - "description": "Azure client secret." - }, - "azure_tenant_id": { - "type": "string", - "description": "Azure tanant ID." - }, - "azure_subscription_id": { - "type": "string", - "description": "Azure subscription ID." - } - }, - "description": "DiscoverAzureDatabaseRequest discover azure databases request." - }, - "v1DiscoverAzureDatabaseResponse": { - "type": "object", - "properties": { - "azure_database_instance": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1DiscoverAzureDatabaseInstance" - } - } - }, - "description": "DiscoverAzureDatabaseResponse discover azure databases response." - }, - "v1DiscoverAzureDatabaseType": { - "type": "string", - "enum": [ - "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", - "DISCOVER_AZURE_DATABASE_TYPE_MYSQL", - "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" - ], - "default": "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", - "description": "DiscoverAzureDatabaseType describes supported Azure Database instance engines.\n\n - DISCOVER_AZURE_DATABASE_TYPE_MYSQL: MySQL type: microsoft.dbformysql or MariaDB type: microsoft.dbformariadb\n - DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL: PostgreSQL type: microsoft.dbformysql" - }, - "v1DiscoverRDSEngine": { - "type": "string", - "enum": [ - "DISCOVER_RDS_ENGINE_UNSPECIFIED", - "DISCOVER_RDS_ENGINE_MYSQL", - "DISCOVER_RDS_ENGINE_POSTGRESQL" - ], - "default": "DISCOVER_RDS_ENGINE_UNSPECIFIED", - "description": "DiscoverRDSEngine describes supported RDS instance engines." - }, - "v1DiscoverRDSInstance": { - "type": "object", - "properties": { - "region": { - "type": "string", - "description": "AWS region." - }, - "az": { - "type": "string", - "description": "AWS availability zone." - }, - "instance_id": { - "type": "string", - "description": "AWS instance ID." - }, - "node_model": { - "type": "string", - "description": "AWS instance class." - }, - "address": { - "type": "string", - "description": "Address used to connect to it." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port." - }, - "engine": { - "$ref": "#/definitions/v1DiscoverRDSEngine", - "description": "Instance engine." - }, - "engine_version": { - "type": "string", - "description": "Engine version." - } - }, - "description": "DiscoverRDSInstance models an unique RDS instance for the list of instances returned by Discovery." - }, - "v1DiscoverRDSRequest": { - "type": "object", - "properties": { - "aws_access_key": { - "type": "string", - "description": "AWS Access key. Optional." - }, - "aws_secret_key": { - "type": "string", - "description": "AWS Secret key. Optional." - } - } - }, - "v1DiscoverRDSResponse": { - "type": "object", - "properties": { - "rds_instances": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1DiscoverRDSInstance" - } - } - } - }, - "v1ExternalExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "runs_on_node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "disabled": { - "type": "boolean", - "description": "If disabled, metrics from this exporter will not be collected." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "HTTP basic auth username for collecting metrics." - }, - "scheme": { - "type": "string", - "description": "Scheme to generate URI to exporter metrics endpoints." - }, - "metrics_path": { - "type": "string", - "description": "Path under which metrics are exposed, used to generate URI." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname verification." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - } - }, - "description": "ExternalExporter runs on any Node type, including Remote Node." - }, - "v1ExternalService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this service instance runs." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "group": { - "type": "string", - "description": "Group name of external service." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP)." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port." - } - }, - "description": "ExternalService represents a generic External service instance." - }, - "v1ExternalServiceResult": { - "type": "object", - "properties": { - "service": { - "$ref": "#/definitions/v1ExternalService" - }, - "external_exporter": { - "$ref": "#/definitions/v1ExternalExporter" - } - } - }, - "v1GenericNode": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "address": { - "type": "string", - "description": "Node address (DNS name or IP)." - }, - "machine_id": { - "type": "string", - "description": "Linux machine-id." - }, - "distro": { - "type": "string", - "description": "Linux distribution name and version." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "is_pmm_server_node": { - "type": "boolean", - "description": "True if this node is a PMM Server node (HA mode)." - } - }, - "description": "GenericNode represents a bare metal server or virtual machine." - }, - "v1GetNodeResponse": { - "type": "object", - "properties": { - "node": { - "$ref": "#/definitions/v1UniversalNode" - } - } - }, - "v1HAProxyService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this service instance runs." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - } - }, - "description": "HAProxyService represents a generic HAProxy service instance." - }, - "v1HAProxyServiceResult": { - "type": "object", - "properties": { - "service": { - "$ref": "#/definitions/v1HAProxyService" - }, - "external_exporter": { - "$ref": "#/definitions/v1ExternalExporter" - } - } - }, - "v1ListAgentVersionsResponse": { - "type": "object", - "properties": { - "agent_versions": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1AgentVersions" - }, - "description": "List of Agent versions." - } - } - }, - "v1ListAgentsResponse": { - "type": "object", - "properties": { - "agents": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1UniversalAgent" - }, - "description": "List of Agents." - } - } - }, - "v1ListNodesResponse": { - "type": "object", - "properties": { - "nodes": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1UniversalNode" - } - } - } - }, - "v1ListServicesResponse": { - "type": "object", - "properties": { - "services": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1UniversalService" - }, - "description": "List of Services." - } - } - }, - "v1LogLevel": { - "type": "string", - "enum": [ - "LOG_LEVEL_UNSPECIFIED", - "LOG_LEVEL_FATAL", - "LOG_LEVEL_ERROR", - "LOG_LEVEL_WARN", - "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" - ], - "default": "LOG_LEVEL_UNSPECIFIED", - "description": "- LOG_LEVEL_UNSPECIFIED: Auto", - "title": "Log level for exporters" - }, - "v1MetricsMode": { - "type": "string", - "enum": [ - "METRICS_MODE_UNSPECIFIED", - "METRICS_MODE_PULL", - "METRICS_MODE_PUSH" - ], - "default": "METRICS_MODE_UNSPECIFIED", - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.\n\n - METRICS_MODE_UNSPECIFIED: Auto" - }, - "v1MongoDBExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MongoDB username for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "disabled_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of disabled collector names." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "stats_collections": { - "type": "array", - "items": { - "type": "string" - }, - "title": "List of colletions to get stats from. Can use *" - }, - "collections_limit": { - "type": "integer", - "format": "int32", - "title": "Collections limit. Only get Databases and collection stats if the total number of collections in the server\nis less than this value. 0: no limit" - }, - "enable_all_collectors": { - "type": "boolean", - "description": "Enable all collectors." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "environment_variable_names": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Environment variable names passed to the exporter." - } - }, - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics." - }, - "v1MongoDBService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "version": { - "type": "string", - "description": "MongoDB version." - } - }, - "description": "MongoDBService represents a generic MongoDB instance." - }, - "v1MongoDBServiceResult": { - "type": "object", - "properties": { - "service": { - "$ref": "#/definitions/v1MongoDBService" - }, - "mongodb_exporter": { - "$ref": "#/definitions/v1MongoDBExporter" - }, - "qan_mongodb_profiler": { - "$ref": "#/definitions/v1QANMongoDBProfilerAgent" - }, - "qan_mongodb_mongolog": { - "$ref": "#/definitions/v1QANMongoDBMongologAgent" - }, - "rta_mongodb_agent": { - "$ref": "#/definitions/v1RTAMongoDBAgent" - } - } - }, - "v1MySQLService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "version": { - "type": "string", - "description": "MySQL version." - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra parameters to be added to the DSN." - } - }, - "description": "MySQLService represents a generic MySQL instance." - }, - "v1MySQLServiceResult": { - "type": "object", - "properties": { - "service": { - "$ref": "#/definitions/v1MySQLService" - }, - "mysqld_exporter": { - "$ref": "#/definitions/v1MySQLdExporter" - }, - "qan_mysql_perfschema": { - "$ref": "#/definitions/v1QANMySQLPerfSchemaAgent" - }, - "qan_mysql_slowlog": { - "$ref": "#/definitions/v1QANMySQLSlowlogAgent" - }, - "table_count": { - "type": "integer", - "format": "int32", - "description": "Actual table count at the moment of adding." - } - } - }, - "v1MySQLdExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MySQL username for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "tls_cert": { - "type": "string", - "description": "Client certificate." - }, - "tls_key": { - "type": "string", - "description": "Password for decrypting tls_cert." - }, - "tablestats_group_table_limit": { - "type": "integer", - "format": "int32", - "description": "Tablestats group collectors are disabled if there are more than that number of tables.\n0 means tablestats group collectors are always enabled (no limit).\nNegative value means tablestats group collectors are always disabled." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "disabled_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of disabled collector names." - }, - "table_count": { - "type": "integer", - "format": "int32", - "description": "Actual table count at the moment of adding." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "tablestats_group_disabled": { - "type": "boolean", - "description": "True if tablestats group collectors are currently disabled." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra DSN parameters for MySQL connection." - } - }, - "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics." - }, - "v1NodeType": { - "type": "string", - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "NODE_TYPE_GENERIC_NODE", - "NODE_TYPE_CONTAINER_NODE", - "NODE_TYPE_REMOTE_NODE", - "NODE_TYPE_REMOTE_RDS_NODE", - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - ], - "default": "NODE_TYPE_UNSPECIFIED", - "description": "NodeType describes supported Node types." - }, - "v1PMMAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "runs_on_node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "connected": { - "type": "boolean", - "description": "True if Agent is running and connected to pmm-managed." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - } - }, - "description": "PMMAgent runs on Generic or Container Node." - }, - "v1PostgreSQLService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "database_name": { - "type": "string", - "description": "Database name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "version": { - "type": "string", - "description": "PostgreSQL version." - }, - "auto_discovery_limit": { - "type": "integer", - "format": "int32", - "description": "Limit of databases for auto-discovery." - } - }, - "description": "PostgreSQLService represents a generic PostgreSQL instance." - }, - "v1PostgreSQLServiceResult": { - "type": "object", - "properties": { - "service": { - "$ref": "#/definitions/v1PostgreSQLService" - }, - "postgres_exporter": { - "$ref": "#/definitions/v1PostgresExporter" - }, - "qan_postgresql_pgstatements_agent": { - "$ref": "#/definitions/v1QANPostgreSQLPgStatementsAgent" - }, - "qan_postgresql_pgstatmonitor_agent": { - "$ref": "#/definitions/v1QANPostgreSQLPgStatMonitorAgent" - }, - "warning": { - "type": "string", - "description": "Warning message." - } - } - }, - "v1PostgresExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "PostgreSQL username for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "disabled_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of disabled collector names." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "auto_discovery_limit": { - "type": "integer", - "format": "int32", - "description": "Limit of databases for auto-discovery." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "max_exporter_connections": { - "type": "integer", - "format": "int32", - "description": "Maximum number of connections that exporter can open to the database instance." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - } - }, - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics." - }, - "v1ProxySQLExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "ProxySQL username for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "disabled_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of disabled collector names." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - } - }, - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics." - }, - "v1ProxySQLService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "version": { - "type": "string", - "description": "ProxySQL version." - } - }, - "description": "ProxySQLService represents a generic ProxySQL instance." - }, - "v1ProxySQLServiceResult": { - "type": "object", - "properties": { - "service": { - "$ref": "#/definitions/v1ProxySQLService" - }, - "proxysql_exporter": { - "$ref": "#/definitions/v1ProxySQLExporter" - } - } - }, - "v1QANMongoDBMongologAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MongoDB username for getting profiler data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - }, - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server." - }, - "v1QANMongoDBProfilerAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MongoDB username for getting profiler data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - }, - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server." - }, - "v1QANMySQLPerfSchemaAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MySQL username for getting performance data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "tls_cert": { - "type": "string", - "description": "Client certificate." - }, - "tls_key": { - "type": "string", - "description": "Password for decrypting tls_cert." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "query_examples_disabled": { - "type": "boolean", - "description": "True if query examples are disabled." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra DSN parameters for MySQL connection." - } - }, - "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server." - }, - "v1QANMySQLSlowlogAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MySQL username for getting performance data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "tls_ca": { - "type": "string", - "description": "Certificate Authority certificate chain." - }, - "tls_cert": { - "type": "string", - "description": "Client certificate." - }, - "tls_key": { - "type": "string", - "description": "Password for decrypting tls_cert." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "title": "Limit query length in QAN (default: server-defined; -1: no limit)" - }, - "query_examples_disabled": { - "type": "boolean", - "description": "True if query examples are disabled." - }, - "max_slowlog_file_size": { - "type": "string", - "format": "int64", - "description": "Slowlog file is rotated at this size if \u003e 0." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "title": "mod tidy" - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "extra_dsn_params": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Extra DSN parameters for MySQL connection." - } - }, - "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server." - }, - "v1QANPostgreSQLPgStatMonitorAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "PostgreSQL username for getting pg stat monitor data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "query_examples_disabled": { - "type": "boolean", - "description": "True if query examples are disabled." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - }, - "description": "QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server." - }, - "v1QANPostgreSQLPgStatementsAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "PostgreSQL username for getting pg stat statements data." - }, - "disable_comments_parsing": { - "type": "boolean", - "description": "Disable parsing comments from queries and showing them in QAN." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN (default: server-defined; -1: no limit)." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - }, - "description": "QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server." - }, - "v1RDSExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "node_id": { - "type": "string", - "description": "Node identifier." - }, - "aws_access_key": { - "type": "string", - "description": "AWS Access Key." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status (the same for several configurations)." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics (the same for several configurations)." - }, - "basic_metrics_disabled": { - "type": "boolean", - "description": "Basic metrics are disabled." - }, - "enhanced_metrics_disabled": { - "type": "boolean", - "description": "Enhanced metrics are disabled." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "auto_discovery_limit": { - "type": "integer", - "format": "int32", - "description": "Limit of databases for auto-discovery." - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - } - }, - "description": "RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics." - }, - "v1RDSServiceResult": { - "type": "object", - "properties": { - "node": { - "$ref": "#/definitions/v1RemoteRDSNode" - }, - "rds_exporter": { - "$ref": "#/definitions/v1RDSExporter" - }, - "mysql": { - "$ref": "#/definitions/v1MySQLService" - }, - "mysqld_exporter": { - "$ref": "#/definitions/v1MySQLdExporter" - }, - "qan_mysql_perfschema": { - "$ref": "#/definitions/v1QANMySQLPerfSchemaAgent" - }, - "postgresql": { - "$ref": "#/definitions/v1PostgreSQLService" - }, - "postgresql_exporter": { - "$ref": "#/definitions/v1PostgresExporter" - }, - "qan_postgresql_pgstatements": { - "$ref": "#/definitions/v1QANPostgreSQLPgStatementsAgent" - } - } - }, - "v1RTAMongoDBAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique agent identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "MongoDB username for getting profiler data." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "rta_options": { - "$ref": "#/definitions/v1RTAOptions", - "description": "Real-Time Analytics options." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - } - }, - "description": "RTAMongoDBAgent runs within pmm-agent and sends MongoDB Real-Time Query Analytics data to the PMM Server." - }, - "v1RTAOptions": { - "type": "object", - "properties": { - "collect_interval": { - "type": "string", - "description": "Query collect interval (default 2s is set by server)." - } - }, - "description": "RTAOptions holds Real-Time Query Analytics agent options." - }, - "v1RegisterNodeRequest": { - "type": "object", - "properties": { - "node_type": { - "$ref": "#/definitions/v1NodeType", - "description": "Node type to be registered." - }, - "node_name": { - "type": "string", - "description": "A user-defined name unique across all Nodes." - }, - "address": { - "type": "string", - "description": "Node address (DNS name or IP)." - }, - "machine_id": { - "type": "string", - "description": "Linux machine-id." - }, - "distro": { - "type": "string", - "description": "Linux distribution name and version." - }, - "container_id": { - "type": "string", - "description": "Container identifier. If specified, must be a unique Docker container identifier." - }, - "container_name": { - "type": "string", - "description": "Container name." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels for Node." - }, - "reregister": { - "type": "boolean", - "description": "If true, and Node with that name already exist, it will be removed with all dependent Services and Agents." - }, - "metrics_mode": { - "$ref": "#/definitions/v1MetricsMode", - "description": "Defines metrics flow model for node_exporter being added by this request.\nMetrics could be pushed to the server with vmagent,\npulled by the server, or the server could choose behavior automatically." - }, - "disable_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of collector names to disable in this exporter." - }, - "agent_password": { - "type": "string", - "description": "Custom password for exporter endpoint /metrics." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "instance_id": { - "type": "string", - "description": "AWS instance ID." - } - } - }, - "v1RegisterNodeResponse": { - "type": "object", - "properties": { - "generic_node": { - "$ref": "#/definitions/v1GenericNode" - }, - "container_node": { - "$ref": "#/definitions/v1ContainerNode" - }, - "pmm_agent": { - "$ref": "#/definitions/v1PMMAgent" - }, - "token": { - "type": "string", - "description": "Token represents token for vmagent auth config." - }, - "warning": { - "type": "string", - "description": "Warning message." - } - } - }, - "v1RemoteRDSNode": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "node_name": { - "type": "string", - "description": "Unique across all Nodes user-defined name." - }, - "address": { - "type": "string", - "description": "DB instance identifier." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "instance_id": { - "type": "string", - "description": "AWS instance ID." - } - }, - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes." - }, - "v1RemoveServiceResponse": { - "type": "object" - }, - "v1ServiceType": { - "type": "string", - "enum": [ - "SERVICE_TYPE_UNSPECIFIED", - "SERVICE_TYPE_MYSQL_SERVICE", - "SERVICE_TYPE_MONGODB_SERVICE", - "SERVICE_TYPE_POSTGRESQL_SERVICE", - "SERVICE_TYPE_VALKEY_SERVICE", - "SERVICE_TYPE_PROXYSQL_SERVICE", - "SERVICE_TYPE_HAPROXY_SERVICE", - "SERVICE_TYPE_EXTERNAL_SERVICE" - ], - "default": "SERVICE_TYPE_UNSPECIFIED", - "description": "ServiceType describes supported Service types." - }, - "v1UniversalAgent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique agent identifier." - }, - "is_agent_password_set": { - "type": "boolean", - "description": "True if the agent password is set." - }, - "agent_type": { - "type": "string", - "description": "Agent type." - }, - "aws_access_key": { - "type": "string", - "description": "AWS Access Key." - }, - "is_aws_secret_key_set": { - "type": "boolean", - "description": "True if AWS Secret Key is set." - }, - "azure_options": { - "$ref": "#/definitions/UniversalAgentAzureOptions", - "description": "Options used for connecting to Azure." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Creation timestamp." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "disabled_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of disabled collector names." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "log_level": { - "$ref": "#/definitions/v1LogLevel", - "description": "Log level for exporter." - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "description": "Limit query length in QAN." - }, - "max_query_log_size": { - "type": "string", - "format": "int64", - "description": "Limit query log size in QAN." - }, - "metrics_path": { - "type": "string", - "description": "Path under which metrics are exposed, used to generate URI." - }, - "metrics_scheme": { - "type": "string", - "description": "Scheme to generate URI to exporter metrics endpoints." - }, - "mongo_db_options": { - "$ref": "#/definitions/UniversalAgentMongoDBOptions", - "description": "TLS and other options for connecting to MongoDB." - }, - "mysql_options": { - "$ref": "#/definitions/UniversalAgentMySQLOptions", - "description": "TLS and other options for connecting to MySQL." - }, - "node_id": { - "type": "string", - "description": "A unique node identifier." - }, - "is_password_set": { - "type": "boolean", - "description": "True if password for connecting the agent to the database is set." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier." - }, - "postgresql_options": { - "$ref": "#/definitions/UniversalAgentPostgreSQLOptions", - "description": "TLS options for connecting to PostgreSQL." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "push_metrics": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "query_examples_disabled": { - "type": "boolean", - "description": "True if query examples are disabled." - }, - "comments_parsing_disabled": { - "type": "boolean", - "description": "True if query comments parsing is disabled." - }, - "rds_basic_metrics_disabled": { - "type": "boolean", - "description": "True if RDS basic metrics are disdabled." - }, - "rds_enhanced_metrics_disabled": { - "type": "boolean", - "description": "True if RDS enhanced metrics are disdabled." - }, - "runs_on_node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "status": { - "type": "string", - "description": "Actual Agent status." - }, - "table_count": { - "type": "integer", - "format": "int32", - "description": "Last known table count." - }, - "table_count_tablestats_group_limit": { - "type": "integer", - "format": "int32", - "description": "Tablestats group collectors are disabled if there are more than that number of tables.\n0 means tablestats group collectors are always enabled (no limit).\nNegative value means tablestats group collectors are always disabled." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname validation." - }, - "username": { - "type": "string", - "description": "HTTP basic auth username for collecting metrics." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "description": "Last update timestamp." - }, - "version": { - "type": "string", - "description": "Agent version." - }, - "is_connected": { - "type": "boolean", - "description": "True if Agent is running and connected to pmm-managed." - }, - "expose_exporter": { - "type": "boolean", - "description": "True if an exporter agent is exposed on all host addresses." - }, - "valkey_options": { - "$ref": "#/definitions/UniversalAgentValkeyOptions", - "description": "Options for connecting to Valkey." - }, - "rta_options": { - "$ref": "#/definitions/v1RTAOptions", - "description": "Real-Time Analytics options." - } - } - }, - "v1UniversalNode": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "Unique Node identifier." - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "node_name": { - "type": "string", - "description": "User-defined node name." - }, - "machine_id": { - "type": "string", - "description": "Linux machine-id." - }, - "distro": { - "type": "string", - "description": "Linux distribution name and version." - }, - "node_model": { - "type": "string", - "description": "Node model." - }, - "container_id": { - "type": "string", - "description": "A node's unique docker container identifier." - }, - "container_name": { - "type": "string", - "description": "Container name." - }, - "address": { - "type": "string", - "description": "Node address (DNS name or IP)." - }, - "region": { - "type": "string", - "description": "Node region." - }, - "az": { - "type": "string", - "description": "Node availability zone." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels for Node." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Creation timestamp." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "description": "Last update timestamp." - }, - "status": { - "$ref": "#/definitions/v1UniversalNodeStatus", - "description": "The health status of the node." - }, - "agents": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/UniversalNodeAgent" - }, - "description": "List of agents related to this node." - }, - "services": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/UniversalNodeService" - }, - "description": "List of services running on this node." - }, - "instance_id": { - "type": "string", - "description": "Instance ID for cloud providers (e.g. AWS RDS)." - }, - "is_pmm_server_node": { - "type": "boolean", - "description": "True if this node is a PMM Server node (HA mode)." - } - } - }, - "v1UniversalNodeStatus": { - "type": "string", - "enum": [ - "STATUS_UNSPECIFIED", - "STATUS_UP", - "STATUS_DOWN", - "STATUS_UNKNOWN" - ], - "default": "STATUS_UNSPECIFIED", - "description": "Node status.\n\n - STATUS_UNSPECIFIED: Invalid status.\n - STATUS_UP: The node is up.\n - STATUS_DOWN: The node is down.\n - STATUS_UNKNOWN: The node's status cannot be known (e.g. there are no metrics yet)." - }, - "v1UniversalService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique service identifier." - }, - "service_type": { - "type": "string", - "description": "Service type." - }, - "service_name": { - "type": "string", - "description": "User-defined name unique across all Services." - }, - "database_name": { - "type": "string", - "description": "Database name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "node_name": { - "type": "string", - "description": "Node name where this instance runs." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels for Service." - }, - "external_group": { - "type": "string", - "description": "External group name." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Creation timestamp." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "description": "Last update timestamp." - }, - "agents": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1UniversalAgent" - }, - "description": "List of agents related to this service." - }, - "status": { - "$ref": "#/definitions/v1UniversalServiceStatus", - "description": "The health status of the service." - }, - "version": { - "type": "string", - "description": "The service/database version." - } - } - }, - "v1UniversalServiceStatus": { - "type": "string", - "enum": [ - "STATUS_UNSPECIFIED", - "STATUS_UP", - "STATUS_DOWN", - "STATUS_UNKNOWN" - ], - "default": "STATUS_UNSPECIFIED", - "description": "Service status.\n\n - STATUS_UNSPECIFIED: In case we don't support the db vendor yet.\n - STATUS_UP: The service is up.\n - STATUS_DOWN: The service is down.\n - STATUS_UNKNOWN: The service's status cannot be known (e.g. there are no metrics yet)." - }, - "v1UnregisterNodeResponse": { - "type": "object", - "properties": { - "warning": { - "type": "string", - "description": "Warning message if there are more service tokens attached to service account." - } - } - }, - "v1UpdateSeverity": { - "type": "string", - "enum": [ - "UPDATE_SEVERITY_UNSPECIFIED", - "UPDATE_SEVERITY_UNSUPPORTED", - "UPDATE_SEVERITY_UP_TO_DATE", - "UPDATE_SEVERITY_REQUIRED", - "UPDATE_SEVERITY_CRITICAL" - ], - "default": "UPDATE_SEVERITY_UNSPECIFIED", - "description": " - UPDATE_SEVERITY_UNSUPPORTED: The client version is newer than the server version.\n - UPDATE_SEVERITY_UP_TO_DATE: The client version matches the server version.\n - UPDATE_SEVERITY_REQUIRED: The client's minor or patch version is older.\n - UPDATE_SEVERITY_CRITICAL: The client's major version is older." - }, - "v1ValkeyExporter": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "pmm_agent_id": { - "type": "string", - "description": "The pmm-agent identifier which runs this instance." - }, - "disabled": { - "type": "boolean", - "description": "Desired Agent status: enabled (false) or disabled (true)." - }, - "service_id": { - "type": "string", - "description": "Service identifier." - }, - "username": { - "type": "string", - "description": "Valkey username for scraping metrics." - }, - "tls": { - "type": "boolean", - "description": "Use TLS for database connections." - }, - "tls_skip_verify": { - "type": "boolean", - "description": "Skip TLS certificate and hostname verification." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "push_metrics_enabled": { - "type": "boolean", - "description": "True if exporter uses push metrics mode." - }, - "disabled_collectors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of disabled collector names." - }, - "status": { - "$ref": "#/definitions/v1AgentStatus", - "description": "Actual Agent status." - }, - "listen_port": { - "type": "integer", - "format": "int64", - "description": "Listen port for scraping metrics." - }, - "process_exec_path": { - "type": "string", - "description": "Path to exec process." - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces" - }, - "metrics_resolutions": { - "$ref": "#/definitions/commonMetricsResolutions", - "description": "Metrics resolution for this agent." - } - }, - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey Service metrics." - }, - "v1ValkeyService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "version": { - "type": "string", - "description": "Valkey version." - } - }, - "description": "ValkeyService represents a generic Valkey instance." - }, - "v1ValkeyServiceResult": { - "type": "object", - "properties": { - "service": { - "$ref": "#/definitions/v1ValkeyService" - }, - "valkey_exporter": { - "$ref": "#/definitions/v1ValkeyExporter" - } - } - } - } -} diff --git a/api/management/v1/service_grpc.pb.go b/api/management/v1/service_grpc.pb.go index fbd5ee9d9ad..69334177242 100644 --- a/api/management/v1/service_grpc.pb.go +++ b/api/management/v1/service_grpc.pb.go @@ -8,6 +8,7 @@ package managementv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -266,42 +267,55 @@ type UnimplementedManagementServiceServer struct{} func (UnimplementedManagementServiceServer) AddAnnotation(context.Context, *AddAnnotationRequest) (*AddAnnotationResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddAnnotation not implemented") } + func (UnimplementedManagementServiceServer) ListAgents(context.Context, *ListAgentsRequest) (*ListAgentsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAgents not implemented") } + func (UnimplementedManagementServiceServer) ListAgentVersions(context.Context, *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAgentVersions not implemented") } + func (UnimplementedManagementServiceServer) RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method RegisterNode not implemented") } + func (UnimplementedManagementServiceServer) UnregisterNode(context.Context, *UnregisterNodeRequest) (*UnregisterNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method UnregisterNode not implemented") } + func (UnimplementedManagementServiceServer) ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListNodes not implemented") } + func (UnimplementedManagementServiceServer) GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetNode not implemented") } + func (UnimplementedManagementServiceServer) CreateNodeInstallToken(context.Context, *CreateNodeInstallTokenRequest) (*CreateNodeInstallTokenResponse, error) { return nil, status.Error(codes.Unimplemented, "method CreateNodeInstallToken not implemented") } + func (UnimplementedManagementServiceServer) AddService(context.Context, *AddServiceRequest) (*AddServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddService not implemented") } + func (UnimplementedManagementServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListServices not implemented") } + func (UnimplementedManagementServiceServer) DiscoverRDS(context.Context, *DiscoverRDSRequest) (*DiscoverRDSResponse, error) { return nil, status.Error(codes.Unimplemented, "method DiscoverRDS not implemented") } + func (UnimplementedManagementServiceServer) DiscoverAzureDatabase(context.Context, *DiscoverAzureDatabaseRequest) (*DiscoverAzureDatabaseResponse, error) { return nil, status.Error(codes.Unimplemented, "method DiscoverAzureDatabase not implemented") } + func (UnimplementedManagementServiceServer) AddAzureDatabase(context.Context, *AddAzureDatabaseRequest) (*AddAzureDatabaseResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddAzureDatabase not implemented") } + func (UnimplementedManagementServiceServer) RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveService not implemented") } diff --git a/api/management/v1/severity.pb.go b/api/management/v1/severity.pb.go index dccdc65ddca..93408b544e2 100644 --- a/api/management/v1/severity.pb.go +++ b/api/management/v1/severity.pb.go @@ -7,11 +7,12 @@ package managementv1 import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -118,10 +119,13 @@ func file_management_v1_severity_proto_rawDescGZIP() []byte { return file_management_v1_severity_proto_rawDescData } -var file_management_v1_severity_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_management_v1_severity_proto_goTypes = []any{ - (Severity)(0), // 0: management.v1.Severity -} +var ( + file_management_v1_severity_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_management_v1_severity_proto_goTypes = []any{ + (Severity)(0), // 0: management.v1.Severity + } +) + var file_management_v1_severity_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/management/v1/severity.swagger.json b/api/management/v1/severity.swagger.json deleted file mode 100644 index 251bda17116..00000000000 --- a/api/management/v1/severity.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/severity.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/management/v1/valkey.pb.go b/api/management/v1/valkey.pb.go index 50e0848541e..37723eea5ec 100644 --- a/api/management/v1/valkey.pb.go +++ b/api/management/v1/valkey.pb.go @@ -7,13 +7,15 @@ package managementv1 import ( - _ "github.com/envoyproxy/protoc-gen-validate/validate" - v1 "github.com/percona/pmm/api/inventory/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -389,17 +391,20 @@ func file_management_v1_valkey_proto_rawDescGZIP() []byte { return file_management_v1_valkey_proto_rawDescData } -var file_management_v1_valkey_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_management_v1_valkey_proto_goTypes = []any{ - (*AddValkeyServiceParams)(nil), // 0: management.v1.AddValkeyServiceParams - (*ValkeyServiceResult)(nil), // 1: management.v1.ValkeyServiceResult - nil, // 2: management.v1.AddValkeyServiceParams.CustomLabelsEntry - (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams - (MetricsMode)(0), // 4: management.v1.MetricsMode - (v1.LogLevel)(0), // 5: inventory.v1.LogLevel - (*v1.ValkeyService)(nil), // 6: inventory.v1.ValkeyService - (*v1.ValkeyExporter)(nil), // 7: inventory.v1.ValkeyExporter -} +var ( + file_management_v1_valkey_proto_msgTypes = make([]protoimpl.MessageInfo, 3) + file_management_v1_valkey_proto_goTypes = []any{ + (*AddValkeyServiceParams)(nil), // 0: management.v1.AddValkeyServiceParams + (*ValkeyServiceResult)(nil), // 1: management.v1.ValkeyServiceResult + nil, // 2: management.v1.AddValkeyServiceParams.CustomLabelsEntry + (*AddNodeParams)(nil), // 3: management.v1.AddNodeParams + (MetricsMode)(0), // 4: management.v1.MetricsMode + (v1.LogLevel)(0), // 5: inventory.v1.LogLevel + (*v1.ValkeyService)(nil), // 6: inventory.v1.ValkeyService + (*v1.ValkeyExporter)(nil), // 7: inventory.v1.ValkeyExporter + } +) + var file_management_v1_valkey_proto_depIdxs = []int32{ 3, // 0: management.v1.AddValkeyServiceParams.add_node:type_name -> management.v1.AddNodeParams 2, // 1: management.v1.AddValkeyServiceParams.custom_labels:type_name -> management.v1.AddValkeyServiceParams.CustomLabelsEntry diff --git a/api/management/v1/valkey.pb.validate.go b/api/management/v1/valkey.pb.validate.go index a2260070a98..55268da8d34 100644 --- a/api/management/v1/valkey.pb.validate.go +++ b/api/management/v1/valkey.pb.validate.go @@ -62,7 +62,6 @@ func (m *AddValkeyServiceParams) validate(all bool) error { var errors []error if m.GetNodeId() != "" { - if utf8.RuneCountInString(m.GetNodeId()) < 1 { err := AddValkeyServiceParamsValidationError{ field: "NodeId", @@ -73,11 +72,9 @@ func (m *AddValkeyServiceParams) validate(all bool) error { } errors = append(errors, err) } - } if m.GetNodeName() != "" { - if utf8.RuneCountInString(m.GetNodeName()) < 1 { err := AddValkeyServiceParamsValidationError{ field: "NodeName", @@ -88,7 +85,6 @@ func (m *AddValkeyServiceParams) validate(all bool) error { } errors = append(errors, err) } - } if all { diff --git a/api/management/v1/valkey.swagger.json b/api/management/v1/valkey.swagger.json deleted file mode 100644 index a0170f19df2..00000000000 --- a/api/management/v1/valkey.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "management/v1/valkey.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "googleRpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - } - } -} diff --git a/api/qan/v1/collector.pb.go b/api/qan/v1/collector.pb.go index b53102e8a73..34b292da2f9 100644 --- a/api/qan/v1/collector.pb.go +++ b/api/qan/v1/collector.pb.go @@ -7,13 +7,15 @@ package qanv1 import ( - v1 "github.com/percona/pmm/api/inventory/v1" - _ "google.golang.org/genproto/googleapis/api/visibility" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + _ "google.golang.org/genproto/googleapis/api/visibility" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -2741,17 +2743,20 @@ func file_qan_v1_collector_proto_rawDescGZIP() []byte { return file_qan_v1_collector_proto_rawDescData } -var file_qan_v1_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_qan_v1_collector_proto_goTypes = []any{ - (*CollectRequest)(nil), // 0: qan.v1.CollectRequest - (*MetricsBucket)(nil), // 1: qan.v1.MetricsBucket - (*CollectResponse)(nil), // 2: qan.v1.CollectResponse - nil, // 3: qan.v1.MetricsBucket.LabelsEntry - nil, // 4: qan.v1.MetricsBucket.WarningsEntry - nil, // 5: qan.v1.MetricsBucket.ErrorsEntry - (v1.AgentType)(0), // 6: inventory.v1.AgentType - (ExampleType)(0), // 7: qan.v1.ExampleType -} +var ( + file_qan_v1_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 6) + file_qan_v1_collector_proto_goTypes = []any{ + (*CollectRequest)(nil), // 0: qan.v1.CollectRequest + (*MetricsBucket)(nil), // 1: qan.v1.MetricsBucket + (*CollectResponse)(nil), // 2: qan.v1.CollectResponse + nil, // 3: qan.v1.MetricsBucket.LabelsEntry + nil, // 4: qan.v1.MetricsBucket.WarningsEntry + nil, // 5: qan.v1.MetricsBucket.ErrorsEntry + (v1.AgentType)(0), // 6: inventory.v1.AgentType + (ExampleType)(0), // 7: qan.v1.ExampleType + } +) + var file_qan_v1_collector_proto_depIdxs = []int32{ 1, // 0: qan.v1.CollectRequest.metrics_bucket:type_name -> qan.v1.MetricsBucket 6, // 1: qan.v1.MetricsBucket.agent_type:type_name -> inventory.v1.AgentType diff --git a/api/qan/v1/collector.swagger.json b/api/qan/v1/collector.swagger.json deleted file mode 100644 index 5313874d3b2..00000000000 --- a/api/qan/v1/collector.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "qan/v1/collector.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/qan/v1/collector_grpc.pb.go b/api/qan/v1/collector_grpc.pb.go index 99faa76e1ce..e13e55d5599 100644 --- a/api/qan/v1/collector_grpc.pb.go +++ b/api/qan/v1/collector_grpc.pb.go @@ -8,6 +8,7 @@ package qanv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/qan/v1/filters.pb.go b/api/qan/v1/filters.pb.go index cffe93c4255..fcbf5e7aead 100644 --- a/api/qan/v1/filters.pb.go +++ b/api/qan/v1/filters.pb.go @@ -7,12 +7,13 @@ package qanv1 import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) const ( @@ -280,16 +281,19 @@ func file_qan_v1_filters_proto_rawDescGZIP() []byte { return file_qan_v1_filters_proto_rawDescData } -var file_qan_v1_filters_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_qan_v1_filters_proto_goTypes = []any{ - (*GetFilteredMetricsNamesRequest)(nil), // 0: qan.v1.GetFilteredMetricsNamesRequest - (*GetFilteredMetricsNamesResponse)(nil), // 1: qan.v1.GetFilteredMetricsNamesResponse - (*ListLabels)(nil), // 2: qan.v1.ListLabels - (*Values)(nil), // 3: qan.v1.Values - nil, // 4: qan.v1.GetFilteredMetricsNamesResponse.LabelsEntry - (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp - (*MapFieldEntry)(nil), // 6: qan.v1.MapFieldEntry -} +var ( + file_qan_v1_filters_proto_msgTypes = make([]protoimpl.MessageInfo, 5) + file_qan_v1_filters_proto_goTypes = []any{ + (*GetFilteredMetricsNamesRequest)(nil), // 0: qan.v1.GetFilteredMetricsNamesRequest + (*GetFilteredMetricsNamesResponse)(nil), // 1: qan.v1.GetFilteredMetricsNamesResponse + (*ListLabels)(nil), // 2: qan.v1.ListLabels + (*Values)(nil), // 3: qan.v1.Values + nil, // 4: qan.v1.GetFilteredMetricsNamesResponse.LabelsEntry + (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp + (*MapFieldEntry)(nil), // 6: qan.v1.MapFieldEntry + } +) + var file_qan_v1_filters_proto_depIdxs = []int32{ 5, // 0: qan.v1.GetFilteredMetricsNamesRequest.period_start_from:type_name -> google.protobuf.Timestamp 5, // 1: qan.v1.GetFilteredMetricsNamesRequest.period_start_to:type_name -> google.protobuf.Timestamp diff --git a/api/qan/v1/filters.swagger.json b/api/qan/v1/filters.swagger.json deleted file mode 100644 index bd5c3eb7ba0..00000000000 --- a/api/qan/v1/filters.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "qan/v1/filters.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/qan/v1/object_details.pb.go b/api/qan/v1/object_details.pb.go index 9a68f9f39d4..25c9db523a5 100644 --- a/api/qan/v1/object_details.pb.go +++ b/api/qan/v1/object_details.pb.go @@ -7,12 +7,13 @@ package qanv1 import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) const ( @@ -1607,39 +1608,42 @@ func file_qan_v1_object_details_proto_rawDescGZIP() []byte { return file_qan_v1_object_details_proto_rawDescData } -var file_qan_v1_object_details_proto_msgTypes = make([]protoimpl.MessageInfo, 26) -var file_qan_v1_object_details_proto_goTypes = []any{ - (*GetMetricsRequest)(nil), // 0: qan.v1.GetMetricsRequest - (*GetMetricsResponse)(nil), // 1: qan.v1.GetMetricsResponse - (*MetricValues)(nil), // 2: qan.v1.MetricValues - (*Labels)(nil), // 3: qan.v1.Labels - (*GetQueryExampleRequest)(nil), // 4: qan.v1.GetQueryExampleRequest - (*GetQueryExampleResponse)(nil), // 5: qan.v1.GetQueryExampleResponse - (*QueryExample)(nil), // 6: qan.v1.QueryExample - (*GetLabelsRequest)(nil), // 7: qan.v1.GetLabelsRequest - (*GetLabelsResponse)(nil), // 8: qan.v1.GetLabelsResponse - (*ListLabelValues)(nil), // 9: qan.v1.ListLabelValues - (*GetQueryPlanRequest)(nil), // 10: qan.v1.GetQueryPlanRequest - (*GetQueryPlanResponse)(nil), // 11: qan.v1.GetQueryPlanResponse - (*GetHistogramRequest)(nil), // 12: qan.v1.GetHistogramRequest - (*GetHistogramResponse)(nil), // 13: qan.v1.GetHistogramResponse - (*HistogramItem)(nil), // 14: qan.v1.HistogramItem - (*QueryExistsRequest)(nil), // 15: qan.v1.QueryExistsRequest - (*QueryExistsResponse)(nil), // 16: qan.v1.QueryExistsResponse - (*SchemaByQueryIDRequest)(nil), // 17: qan.v1.SchemaByQueryIDRequest - (*SchemaByQueryIDResponse)(nil), // 18: qan.v1.SchemaByQueryIDResponse - (*ExplainFingerprintByQueryIDRequest)(nil), // 19: qan.v1.ExplainFingerprintByQueryIDRequest - (*ExplainFingerprintByQueryIDResponse)(nil), // 20: qan.v1.ExplainFingerprintByQueryIDResponse - (*GetSelectedQueryMetadataResponse)(nil), // 21: qan.v1.GetSelectedQueryMetadataResponse - nil, // 22: qan.v1.GetMetricsResponse.MetricsEntry - nil, // 23: qan.v1.GetMetricsResponse.TextMetricsEntry - nil, // 24: qan.v1.GetMetricsResponse.TotalsEntry - nil, // 25: qan.v1.GetLabelsResponse.LabelsEntry - (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp - (*MapFieldEntry)(nil), // 27: qan.v1.MapFieldEntry - (*Point)(nil), // 28: qan.v1.Point - (ExampleType)(0), // 29: qan.v1.ExampleType -} +var ( + file_qan_v1_object_details_proto_msgTypes = make([]protoimpl.MessageInfo, 26) + file_qan_v1_object_details_proto_goTypes = []any{ + (*GetMetricsRequest)(nil), // 0: qan.v1.GetMetricsRequest + (*GetMetricsResponse)(nil), // 1: qan.v1.GetMetricsResponse + (*MetricValues)(nil), // 2: qan.v1.MetricValues + (*Labels)(nil), // 3: qan.v1.Labels + (*GetQueryExampleRequest)(nil), // 4: qan.v1.GetQueryExampleRequest + (*GetQueryExampleResponse)(nil), // 5: qan.v1.GetQueryExampleResponse + (*QueryExample)(nil), // 6: qan.v1.QueryExample + (*GetLabelsRequest)(nil), // 7: qan.v1.GetLabelsRequest + (*GetLabelsResponse)(nil), // 8: qan.v1.GetLabelsResponse + (*ListLabelValues)(nil), // 9: qan.v1.ListLabelValues + (*GetQueryPlanRequest)(nil), // 10: qan.v1.GetQueryPlanRequest + (*GetQueryPlanResponse)(nil), // 11: qan.v1.GetQueryPlanResponse + (*GetHistogramRequest)(nil), // 12: qan.v1.GetHistogramRequest + (*GetHistogramResponse)(nil), // 13: qan.v1.GetHistogramResponse + (*HistogramItem)(nil), // 14: qan.v1.HistogramItem + (*QueryExistsRequest)(nil), // 15: qan.v1.QueryExistsRequest + (*QueryExistsResponse)(nil), // 16: qan.v1.QueryExistsResponse + (*SchemaByQueryIDRequest)(nil), // 17: qan.v1.SchemaByQueryIDRequest + (*SchemaByQueryIDResponse)(nil), // 18: qan.v1.SchemaByQueryIDResponse + (*ExplainFingerprintByQueryIDRequest)(nil), // 19: qan.v1.ExplainFingerprintByQueryIDRequest + (*ExplainFingerprintByQueryIDResponse)(nil), // 20: qan.v1.ExplainFingerprintByQueryIDResponse + (*GetSelectedQueryMetadataResponse)(nil), // 21: qan.v1.GetSelectedQueryMetadataResponse + nil, // 22: qan.v1.GetMetricsResponse.MetricsEntry + nil, // 23: qan.v1.GetMetricsResponse.TextMetricsEntry + nil, // 24: qan.v1.GetMetricsResponse.TotalsEntry + nil, // 25: qan.v1.GetLabelsResponse.LabelsEntry + (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp + (*MapFieldEntry)(nil), // 27: qan.v1.MapFieldEntry + (*Point)(nil), // 28: qan.v1.Point + (ExampleType)(0), // 29: qan.v1.ExampleType + } +) + var file_qan_v1_object_details_proto_depIdxs = []int32{ 26, // 0: qan.v1.GetMetricsRequest.period_start_from:type_name -> google.protobuf.Timestamp 26, // 1: qan.v1.GetMetricsRequest.period_start_to:type_name -> google.protobuf.Timestamp diff --git a/api/qan/v1/object_details.swagger.json b/api/qan/v1/object_details.swagger.json deleted file mode 100644 index e5465adaa29..00000000000 --- a/api/qan/v1/object_details.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "qan/v1/object_details.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/qan/v1/profile.pb.go b/api/qan/v1/profile.pb.go index 2dce8283404..03ab97e871a 100644 --- a/api/qan/v1/profile.pb.go +++ b/api/qan/v1/profile.pb.go @@ -7,12 +7,13 @@ package qanv1 import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) const ( @@ -583,18 +584,21 @@ func file_qan_v1_profile_proto_rawDescGZIP() []byte { return file_qan_v1_profile_proto_rawDescData } -var file_qan_v1_profile_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_qan_v1_profile_proto_goTypes = []any{ - (*GetReportRequest)(nil), // 0: qan.v1.GetReportRequest - (*ReportMapFieldEntry)(nil), // 1: qan.v1.ReportMapFieldEntry - (*GetReportResponse)(nil), // 2: qan.v1.GetReportResponse - (*Row)(nil), // 3: qan.v1.Row - (*Metric)(nil), // 4: qan.v1.Metric - (*Stat)(nil), // 5: qan.v1.Stat - nil, // 6: qan.v1.Row.MetricsEntry - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp - (*Point)(nil), // 8: qan.v1.Point -} +var ( + file_qan_v1_profile_proto_msgTypes = make([]protoimpl.MessageInfo, 7) + file_qan_v1_profile_proto_goTypes = []any{ + (*GetReportRequest)(nil), // 0: qan.v1.GetReportRequest + (*ReportMapFieldEntry)(nil), // 1: qan.v1.ReportMapFieldEntry + (*GetReportResponse)(nil), // 2: qan.v1.GetReportResponse + (*Row)(nil), // 3: qan.v1.Row + (*Metric)(nil), // 4: qan.v1.Metric + (*Stat)(nil), // 5: qan.v1.Stat + nil, // 6: qan.v1.Row.MetricsEntry + (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp + (*Point)(nil), // 8: qan.v1.Point + } +) + var file_qan_v1_profile_proto_depIdxs = []int32{ 7, // 0: qan.v1.GetReportRequest.period_start_from:type_name -> google.protobuf.Timestamp 7, // 1: qan.v1.GetReportRequest.period_start_to:type_name -> google.protobuf.Timestamp diff --git a/api/qan/v1/profile.swagger.json b/api/qan/v1/profile.swagger.json deleted file mode 100644 index d893a4c50f0..00000000000 --- a/api/qan/v1/profile.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "qan/v1/profile.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/qan/v1/qan.pb.go b/api/qan/v1/qan.pb.go index 8151058b8ea..629cc7d94b5 100644 --- a/api/qan/v1/qan.pb.go +++ b/api/qan/v1/qan.pb.go @@ -7,11 +7,12 @@ package qanv1 import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -990,13 +991,16 @@ func file_qan_v1_qan_proto_rawDescGZIP() []byte { return file_qan_v1_qan_proto_rawDescData } -var file_qan_v1_qan_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_qan_v1_qan_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_qan_v1_qan_proto_goTypes = []any{ - (ExampleType)(0), // 0: qan.v1.ExampleType - (*Point)(nil), // 1: qan.v1.Point - (*MapFieldEntry)(nil), // 2: qan.v1.MapFieldEntry -} +var ( + file_qan_v1_qan_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_qan_v1_qan_proto_msgTypes = make([]protoimpl.MessageInfo, 2) + file_qan_v1_qan_proto_goTypes = []any{ + (ExampleType)(0), // 0: qan.v1.ExampleType + (*Point)(nil), // 1: qan.v1.Point + (*MapFieldEntry)(nil), // 2: qan.v1.MapFieldEntry + } +) + var file_qan_v1_qan_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/api/qan/v1/qan.swagger.json b/api/qan/v1/qan.swagger.json deleted file mode 100644 index eef59052f3e..00000000000 --- a/api/qan/v1/qan.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "qan/v1/qan.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/qan/v1/service.pb.go b/api/qan/v1/service.pb.go index 05c3c795339..0e52423aa51 100644 --- a/api/qan/v1/service.pb.go +++ b/api/qan/v1/service.pb.go @@ -7,13 +7,14 @@ package qanv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" ) const ( @@ -227,34 +228,37 @@ func file_qan_v1_service_proto_rawDescGZIP() []byte { return file_qan_v1_service_proto_rawDescData } -var file_qan_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_qan_v1_service_proto_goTypes = []any{ - (*GetMetricsNamesRequest)(nil), // 0: qan.v1.GetMetricsNamesRequest - (*GetMetricsNamesResponse)(nil), // 1: qan.v1.GetMetricsNamesResponse - (*HealthCheckRequest)(nil), // 2: qan.v1.HealthCheckRequest - (*HealthCheckResponse)(nil), // 3: qan.v1.HealthCheckResponse - nil, // 4: qan.v1.GetMetricsNamesResponse.DataEntry - (*GetReportRequest)(nil), // 5: qan.v1.GetReportRequest - (*GetFilteredMetricsNamesRequest)(nil), // 6: qan.v1.GetFilteredMetricsNamesRequest - (*GetMetricsRequest)(nil), // 7: qan.v1.GetMetricsRequest - (*GetLabelsRequest)(nil), // 8: qan.v1.GetLabelsRequest - (*GetHistogramRequest)(nil), // 9: qan.v1.GetHistogramRequest - (*ExplainFingerprintByQueryIDRequest)(nil), // 10: qan.v1.ExplainFingerprintByQueryIDRequest - (*GetQueryPlanRequest)(nil), // 11: qan.v1.GetQueryPlanRequest - (*QueryExistsRequest)(nil), // 12: qan.v1.QueryExistsRequest - (*SchemaByQueryIDRequest)(nil), // 13: qan.v1.SchemaByQueryIDRequest - (*GetQueryExampleRequest)(nil), // 14: qan.v1.GetQueryExampleRequest - (*GetReportResponse)(nil), // 15: qan.v1.GetReportResponse - (*GetFilteredMetricsNamesResponse)(nil), // 16: qan.v1.GetFilteredMetricsNamesResponse - (*GetMetricsResponse)(nil), // 17: qan.v1.GetMetricsResponse - (*GetLabelsResponse)(nil), // 18: qan.v1.GetLabelsResponse - (*GetHistogramResponse)(nil), // 19: qan.v1.GetHistogramResponse - (*ExplainFingerprintByQueryIDResponse)(nil), // 20: qan.v1.ExplainFingerprintByQueryIDResponse - (*GetQueryPlanResponse)(nil), // 21: qan.v1.GetQueryPlanResponse - (*QueryExistsResponse)(nil), // 22: qan.v1.QueryExistsResponse - (*SchemaByQueryIDResponse)(nil), // 23: qan.v1.SchemaByQueryIDResponse - (*GetQueryExampleResponse)(nil), // 24: qan.v1.GetQueryExampleResponse -} +var ( + file_qan_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5) + file_qan_v1_service_proto_goTypes = []any{ + (*GetMetricsNamesRequest)(nil), // 0: qan.v1.GetMetricsNamesRequest + (*GetMetricsNamesResponse)(nil), // 1: qan.v1.GetMetricsNamesResponse + (*HealthCheckRequest)(nil), // 2: qan.v1.HealthCheckRequest + (*HealthCheckResponse)(nil), // 3: qan.v1.HealthCheckResponse + nil, // 4: qan.v1.GetMetricsNamesResponse.DataEntry + (*GetReportRequest)(nil), // 5: qan.v1.GetReportRequest + (*GetFilteredMetricsNamesRequest)(nil), // 6: qan.v1.GetFilteredMetricsNamesRequest + (*GetMetricsRequest)(nil), // 7: qan.v1.GetMetricsRequest + (*GetLabelsRequest)(nil), // 8: qan.v1.GetLabelsRequest + (*GetHistogramRequest)(nil), // 9: qan.v1.GetHistogramRequest + (*ExplainFingerprintByQueryIDRequest)(nil), // 10: qan.v1.ExplainFingerprintByQueryIDRequest + (*GetQueryPlanRequest)(nil), // 11: qan.v1.GetQueryPlanRequest + (*QueryExistsRequest)(nil), // 12: qan.v1.QueryExistsRequest + (*SchemaByQueryIDRequest)(nil), // 13: qan.v1.SchemaByQueryIDRequest + (*GetQueryExampleRequest)(nil), // 14: qan.v1.GetQueryExampleRequest + (*GetReportResponse)(nil), // 15: qan.v1.GetReportResponse + (*GetFilteredMetricsNamesResponse)(nil), // 16: qan.v1.GetFilteredMetricsNamesResponse + (*GetMetricsResponse)(nil), // 17: qan.v1.GetMetricsResponse + (*GetLabelsResponse)(nil), // 18: qan.v1.GetLabelsResponse + (*GetHistogramResponse)(nil), // 19: qan.v1.GetHistogramResponse + (*ExplainFingerprintByQueryIDResponse)(nil), // 20: qan.v1.ExplainFingerprintByQueryIDResponse + (*GetQueryPlanResponse)(nil), // 21: qan.v1.GetQueryPlanResponse + (*QueryExistsResponse)(nil), // 22: qan.v1.QueryExistsResponse + (*SchemaByQueryIDResponse)(nil), // 23: qan.v1.SchemaByQueryIDResponse + (*GetQueryExampleResponse)(nil), // 24: qan.v1.GetQueryExampleResponse + } +) + var file_qan_v1_service_proto_depIdxs = []int32{ 4, // 0: qan.v1.GetMetricsNamesResponse.data:type_name -> qan.v1.GetMetricsNamesResponse.DataEntry 5, // 1: qan.v1.QANService.GetReport:input_type -> qan.v1.GetReportRequest diff --git a/api/qan/v1/service.swagger.json b/api/qan/v1/service.swagger.json deleted file mode 100644 index d3b007a1e21..00000000000 --- a/api/qan/v1/service.swagger.json +++ /dev/null @@ -1,1568 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "qan/v1/service.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "QANService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/qan/health": { - "get": { - "summary": "Health Check", - "description": "Returns readiness of QAN API2 service.", - "operationId": "HealthCheck", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1HealthCheckResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "QANService" - ] - } - }, - "/v1/qan/metrics:getFilters": { - "post": { - "summary": "Get Filters", - "description": "Provides a filtered map of metrics names.", - "operationId": "GetFilteredMetricsNames", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetFilteredMetricsNamesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "GetFilteredMetricsNamesRequest contains period for which we need filters.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1GetFilteredMetricsNamesRequest" - } - } - ], - "tags": [ - "QANService" - ] - } - }, - "/v1/qan/metrics:getNames": { - "post": { - "summary": "Get Metrics Names", - "description": "Provides a map of all metrics names.", - "operationId": "GetMetricsNames", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetMetricsNamesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "MetricsNamesRequest is empty.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1GetMetricsNamesRequest" - } - } - ], - "tags": [ - "QANService" - ] - } - }, - "/v1/qan/metrics:getReport": { - "post": { - "summary": "Get Report", - "description": "Returns a list of metrics grouped by queryid or other dimensions.", - "operationId": "GetReport", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetReportResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "ReportRequest defines filtering of metrics report for db server or other dimentions.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1GetReportRequest" - } - } - ], - "tags": [ - "QANService" - ] - } - }, - "/v1/qan/query/{queryid}/plan": { - "get": { - "summary": "Get Query Plan", - "description": "Provides a query plan and plan id for specific filtering.", - "operationId": "GetQueryPlan", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetQueryPlanResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "queryid", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "QANService" - ] - } - }, - "/v1/qan/query:exists": { - "post": { - "summary": "Check Query Existence", - "description": "Checks if query exists in clickhouse.", - "operationId": "QueryExists", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1QueryExistsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "QueryExistsRequest check if provided query exists or not.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1QueryExistsRequest" - } - } - ], - "tags": [ - "QANService" - ] - } - }, - "/v1/qan/query:getExample": { - "post": { - "summary": "Get Query Example", - "description": "Provides a list of query examples.", - "operationId": "GetQueryExample", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetQueryExampleResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "GetQueryExampleRequest defines filtering of query examples for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1GetQueryExampleRequest" - } - } - ], - "tags": [ - "QANService" - ] - } - }, - "/v1/qan/query:getSchema": { - "post": { - "summary": "Get Schema", - "description": "Provides the schema for a given queryID and serviceID.", - "operationId": "SchemaByQueryID", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1SchemaByQueryIDResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1SchemaByQueryIDRequest" - } - } - ], - "tags": [ - "QANService" - ] - } - }, - "/v1/qan:explainFingerprint": { - "post": { - "summary": "Get Explain Fingerprint", - "description": "Provides an explain fingerprint for given query ID.", - "operationId": "ExplainFingerprintByQueryID", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ExplainFingerprintByQueryIDResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1ExplainFingerprintByQueryIDRequest" - } - } - ], - "tags": [ - "QANService" - ] - } - }, - "/v1/qan:getHistogram": { - "post": { - "summary": "Get Histogram", - "description": "Provides histogram items for specific filtering.", - "operationId": "GetHistogram", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetHistogramResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "GetHistogramRequest defines filtering by time range, labels and queryid.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1GetHistogramRequest" - } - } - ], - "tags": [ - "QANService" - ] - } - }, - "/v1/qan:getLabels": { - "post": { - "summary": "Get Labels", - "description": "Provides a list of labels for object details.", - "operationId": "GetLabels", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetLabelsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "GetLabelsRequest defines filtering of object detail's labels for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1GetLabelsRequest" - } - } - ], - "tags": [ - "QANService" - ] - } - }, - "/v1/qan:getMetrics": { - "post": { - "summary": "Get Metrics", - "description": "Provides a map of metrics for specific filtering.", - "operationId": "GetMetrics", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetMetricsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "GetMetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1GetMetricsRequest" - } - } - ], - "tags": [ - "QANService" - ] - } - } - }, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1ExampleType": { - "type": "string", - "enum": [ - "EXAMPLE_TYPE_UNSPECIFIED", - "EXAMPLE_TYPE_RANDOM", - "EXAMPLE_TYPE_SLOWEST", - "EXAMPLE_TYPE_FASTEST", - "EXAMPLE_TYPE_WITH_ERROR" - ], - "default": "EXAMPLE_TYPE_UNSPECIFIED", - "description": "ExampleType is a type of query example selected for this query class in given period of time." - }, - "v1ExplainFingerprintByQueryIDRequest": { - "type": "object", - "properties": { - "serviceid": { - "type": "string" - }, - "query_id": { - "type": "string" - } - }, - "description": "ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID." - }, - "v1ExplainFingerprintByQueryIDResponse": { - "type": "object", - "properties": { - "explain_fingerprint": { - "type": "string" - }, - "placeholders_count": { - "type": "integer", - "format": "int64" - } - }, - "description": "ExplainFingerprintByQueryIDResponse is explain fingerprint and placeholders count for given query ID." - }, - "v1GetFilteredMetricsNamesRequest": { - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time" - }, - "period_start_to": { - "type": "string", - "format": "date-time" - }, - "main_metric_name": { - "type": "string" - }, - "labels": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1MapFieldEntry" - } - } - }, - "description": "GetFilteredMetricsNamesRequest contains period for which we need filters." - }, - "v1GetFilteredMetricsNamesResponse": { - "type": "object", - "properties": { - "labels": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/v1ListLabels" - } - } - }, - "description": "GetFilteredMetricsNamesResponse is map of labels for given period by key.\nKey is label's name and value is label's value and how many times it occur." - }, - "v1GetHistogramRequest": { - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time" - }, - "period_start_to": { - "type": "string", - "format": "date-time" - }, - "labels": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1MapFieldEntry" - } - }, - "queryid": { - "type": "string" - } - }, - "description": "GetHistogramRequest defines filtering by time range, labels and queryid." - }, - "v1GetHistogramResponse": { - "type": "object", - "properties": { - "histogram_items": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1HistogramItem" - } - } - }, - "description": "GetHistogramResponse is histogram items as a list." - }, - "v1GetLabelsRequest": { - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time" - }, - "period_start_to": { - "type": "string", - "format": "date-time" - }, - "filter_by": { - "type": "string", - "description": "dimension value: ex: queryid - 1D410B4BE5060972." - }, - "group_by": { - "type": "string", - "description": "one of dimension: queryid | host ..." - } - }, - "description": "GetLabelsRequest defines filtering of object detail's labels for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972." - }, - "v1GetLabelsResponse": { - "type": "object", - "properties": { - "labels": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/v1ListLabelValues" - } - } - }, - "description": "GetLabelsResponse is a map of labels names as keys and labels values as a list." - }, - "v1GetMetricsNamesRequest": { - "type": "object", - "description": "MetricsNamesRequest is empty." - }, - "v1GetMetricsNamesResponse": { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "description": "MetricsNamesReply is map of stored metrics:\nkey is root of metric name in db (Ex:. [m_]query_time[_sum]);\nvalue - Human readable name of metrics." - }, - "v1GetMetricsRequest": { - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time" - }, - "period_start_to": { - "type": "string", - "format": "date-time" - }, - "filter_by": { - "type": "string", - "description": "dimension value: ex: queryid - 1D410B4BE5060972." - }, - "group_by": { - "type": "string", - "description": "one of dimension: queryid | host ..." - }, - "labels": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1MapFieldEntry" - } - }, - "include_only_fields": { - "type": "array", - "items": { - "type": "string" - } - }, - "totals": { - "type": "boolean", - "title": "retrieve only values for totals, excluding N/A values" - } - }, - "description": "GetMetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972." - }, - "v1GetMetricsResponse": { - "type": "object", - "properties": { - "metrics": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/v1MetricValues" - } - }, - "text_metrics": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "sparkline": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Point" - } - }, - "totals": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/v1MetricValues" - } - }, - "fingerprint": { - "type": "string" - }, - "metadata": { - "$ref": "#/definitions/v1GetSelectedQueryMetadataResponse" - } - }, - "description": "GetMetricsResponse defines metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972." - }, - "v1GetQueryExampleRequest": { - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time" - }, - "period_start_to": { - "type": "string", - "format": "date-time" - }, - "filter_by": { - "type": "string", - "description": "dimension value: ex: queryid - 1D410B4BE5060972." - }, - "group_by": { - "type": "string", - "description": "one of dimension: queryid | host ..." - }, - "labels": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1MapFieldEntry" - } - }, - "limit": { - "type": "integer", - "format": "int64" - } - }, - "description": "GetQueryExampleRequest defines filtering of query examples for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972." - }, - "v1GetQueryExampleResponse": { - "type": "object", - "properties": { - "query_examples": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1QueryExample" - } - } - }, - "description": "GetQueryExampleResponse list of query examples." - }, - "v1GetQueryPlanResponse": { - "type": "object", - "properties": { - "planid": { - "type": "string" - }, - "query_plan": { - "type": "string" - } - }, - "description": "GetQueryPlanResponse contains planid and query_plan." - }, - "v1GetReportRequest": { - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time" - }, - "period_start_to": { - "type": "string", - "format": "date-time" - }, - "group_by": { - "type": "string" - }, - "labels": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1ReportMapFieldEntry" - } - }, - "columns": { - "type": "array", - "items": { - "type": "string" - } - }, - "order_by": { - "type": "string" - }, - "offset": { - "type": "integer", - "format": "int64" - }, - "limit": { - "type": "integer", - "format": "int64" - }, - "main_metric": { - "type": "string" - }, - "search": { - "type": "string" - } - }, - "description": "ReportRequest defines filtering of metrics report for db server or other dimentions." - }, - "v1GetReportResponse": { - "type": "object", - "properties": { - "total_rows": { - "type": "integer", - "format": "int64" - }, - "offset": { - "type": "integer", - "format": "int64" - }, - "limit": { - "type": "integer", - "format": "int64" - }, - "rows": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Row" - } - } - }, - "description": "ReportReply is list of reports per quieryids, hosts etc." - }, - "v1GetSelectedQueryMetadataResponse": { - "type": "object", - "properties": { - "service_name": { - "type": "string" - }, - "database": { - "type": "string" - }, - "schema": { - "type": "string" - }, - "username": { - "type": "string" - }, - "replication_set": { - "type": "string" - }, - "cluster": { - "type": "string" - }, - "service_type": { - "type": "string" - }, - "service_id": { - "type": "string" - }, - "environment": { - "type": "string" - }, - "node_id": { - "type": "string" - }, - "node_name": { - "type": "string" - }, - "node_type": { - "type": "string" - } - }, - "description": "GetSlecetedQueryMetadataResponse consists selected query metadata to show in details for given query ID." - }, - "v1HealthCheckResponse": { - "type": "object", - "description": "HealthCheckResponse is empty, based on returned error qan-api2 is ready or not." - }, - "v1HistogramItem": { - "type": "object", - "properties": { - "range": { - "type": "string" - }, - "frequency": { - "type": "integer", - "format": "int64" - } - }, - "description": "HistogramItem represents one item in histogram." - }, - "v1ListLabelValues": { - "type": "object", - "properties": { - "values": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "description": "ListLabelValues is list of label's values." - }, - "v1ListLabels": { - "type": "object", - "properties": { - "name": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Values" - } - } - }, - "description": "ListLabels is list of label's values: duplicates are impossible." - }, - "v1MapFieldEntry": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}." - }, - "v1Metric": { - "type": "object", - "properties": { - "stats": { - "$ref": "#/definitions/v1Stat" - } - }, - "description": "Metric cell." - }, - "v1MetricValues": { - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float" - }, - "cnt": { - "type": "number", - "format": "float" - }, - "sum": { - "type": "number", - "format": "float" - }, - "min": { - "type": "number", - "format": "float" - }, - "max": { - "type": "number", - "format": "float" - }, - "avg": { - "type": "number", - "format": "float" - }, - "p99": { - "type": "number", - "format": "float" - }, - "percent_of_total": { - "type": "number", - "format": "float" - } - }, - "description": "MetricValues is statistics of specific metric." - }, - "v1Point": { - "type": "object", - "properties": { - "point": { - "type": "integer", - "format": "int64", - "description": "The serial number of the chart point from the largest time in the time interval to the lowest time in the time range." - }, - "time_frame": { - "type": "integer", - "format": "int64", - "description": "Duration beetween two points." - }, - "timestamp": { - "type": "string", - "description": "Time of point in format RFC3339." - }, - "load": { - "type": "number", - "format": "float", - "description": "load is query_time / time_range." - }, - "num_queries_per_sec": { - "type": "number", - "format": "float", - "description": "number of queries in bucket." - }, - "num_queries_with_errors_per_sec": { - "type": "number", - "format": "float", - "description": "number of queries with errors." - }, - "num_queries_with_warnings_per_sec": { - "type": "number", - "format": "float", - "description": "number of queries with warnings." - }, - "m_query_time_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The statement execution time in seconds." - }, - "m_lock_time_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The time to acquire locks in seconds." - }, - "m_rows_sent_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of rows sent to the client." - }, - "m_rows_examined_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Number of rows scanned - SELECT." - }, - "m_rows_affected_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Number of rows changed - UPDATE, DELETE, INSERT." - }, - "m_rows_read_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of rows read from tables." - }, - "m_merge_passes_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of merge passes that the sort algorithm has had to do." - }, - "m_innodb_io_r_ops_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Counts the number of page read operations scheduled." - }, - "m_innodb_io_r_bytes_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Similar to innodb_IO_r_ops, but the unit is bytes." - }, - "m_innodb_io_r_wait_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Shows how long (in seconds) it took InnoDB to actually read the data from storage." - }, - "m_innodb_rec_lock_wait_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Shows how long (in seconds) the query waited for row locks." - }, - "m_innodb_queue_wait_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution." - }, - "m_innodb_pages_distinct_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Counts approximately the number of unique pages the query accessed." - }, - "m_query_length_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Shows how long the query is." - }, - "m_bytes_sent_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of bytes sent to all clients." - }, - "m_tmp_tables_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Number of temporary tables created on memory for the query." - }, - "m_tmp_disk_tables_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Number of temporary tables created on disk for the query." - }, - "m_tmp_table_sizes_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total Size in bytes for all temporary tables used in the query." - }, - "m_qc_hit_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Query Cache hits." - }, - "m_full_scan_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The query performed a full table scan." - }, - "m_full_join_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The query performed a full join (a join without indexes)." - }, - "m_tmp_table_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The query created an implicit internal temporary table." - }, - "m_tmp_table_on_disk_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The querys temporary table was stored on disk." - }, - "m_filesort_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The query used a filesort." - }, - "m_filesort_on_disk_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The filesort was performed on disk." - }, - "m_select_full_range_join_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of joins that used a range search on a reference table." - }, - "m_select_range_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of joins that used ranges on the first table." - }, - "m_select_range_check_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of joins without keys that check for key usage after each row." - }, - "m_sort_range_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of sorts that were done using ranges." - }, - "m_sort_rows_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of sorted rows." - }, - "m_sort_scan_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of sorts that were done by scanning the table." - }, - "m_no_index_used_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of queries without index." - }, - "m_no_good_index_used_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of queries without good index." - }, - "m_docs_returned_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of returned documents." - }, - "m_response_length_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The response length of the query result in bytes." - }, - "m_docs_scanned_sum_per_sec": { - "type": "number", - "format": "float", - "description": "The number of scanned documents." - }, - "m_docs_examined_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of documents scanned during query execution." - }, - "m_keys_examined_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of index keys scanned during query execution." - }, - "m_locks_global_acquire_count_read_shared_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Number of times a global read lock was acquired during query execution." - }, - "m_locks_global_acquire_count_write_shared_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Number of times a global write lock was acquired during query execution." - }, - "m_locks_database_acquire_count_read_shared_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Number of times a read lock was acquired at the database level during query execution." - }, - "m_locks_database_acquire_wait_count_read_shared_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Number of times a read lock at the database level was requested but had to wait before being granted." - }, - "m_locks_database_time_acquiring_micros_read_shared_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Indicates the time, spent acquiring a read lock at the database level during an operation." - }, - "m_locks_collection_acquire_count_read_shared_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Number of times a read lock was acquired on a specific collection during operations." - }, - "m_storage_bytes_read_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of bytes read from storage during a specific operation." - }, - "m_storage_time_reading_micros_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Indicates the time, spent reading data from storage during an operation." - }, - "m_shared_blks_hit_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of shared block cache hits by the statement." - }, - "m_shared_blks_read_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of shared blocks read by the statement." - }, - "m_shared_blks_dirtied_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of shared blocks dirtied by the statement." - }, - "m_shared_blks_written_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of shared blocks written by the statement." - }, - "m_shared_blk_read_time_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)." - }, - "m_shared_blk_write_time_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)." - }, - "m_local_blk_read_time_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)." - }, - "m_local_blk_write_time_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)." - }, - "m_local_blks_hit_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of local block cache hits by the statement." - }, - "m_local_blks_read_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of local blocks read by the statement." - }, - "m_local_blks_dirtied_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of local blocks dirtied by the statement." - }, - "m_local_blks_written_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of local blocks written by the statement." - }, - "m_temp_blks_read_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of temp blocks read by the statement." - }, - "m_temp_blks_written_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of temp blocks written by the statement." - }, - "m_blk_read_time_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)." - }, - "m_blk_write_time_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)." - }, - "m_cpu_user_time_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total time user spent in query." - }, - "m_cpu_sys_time_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total time system spent in query." - }, - "m_plans_calls_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of planned calls." - }, - "m_wal_records_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of WAL (Write-ahead logging) records." - }, - "m_wal_fpi_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of FPI (full page images) in WAL (Write-ahead logging) records." - }, - "m_wal_bytes_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total bytes of WAL (Write-ahead logging) records." - }, - "m_wal_buffers_full_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of times WAL buffers become full." - }, - "m_parallel_workers_to_launch_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of parallel workers to launch." - }, - "m_parallel_workers_launched_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Total number of parallel workers launched." - }, - "m_plan_time_sum_per_sec": { - "type": "number", - "format": "float", - "description": "Plan time in per seconds." - } - }, - "description": "Point contains values that represents abscissa (time) and ordinate (volume etc.)\nof every point in a coordinate system of Sparklines." - }, - "v1QueryExample": { - "type": "object", - "properties": { - "example": { - "type": "string" - }, - "example_type": { - "$ref": "#/definitions/v1ExampleType" - }, - "is_truncated": { - "type": "integer", - "format": "int64" - }, - "placeholders_count": { - "type": "integer", - "format": "int64" - }, - "explain_fingerprint": { - "type": "string" - }, - "query_id": { - "type": "string" - }, - "example_metrics": { - "type": "string" - }, - "service_id": { - "type": "string" - }, - "service_type": { - "type": "string" - }, - "schema": { - "type": "string" - }, - "tables": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "description": "QueryExample shows query examples and their metrics." - }, - "v1QueryExistsRequest": { - "type": "object", - "properties": { - "serviceid": { - "type": "string" - }, - "query": { - "type": "string" - } - }, - "description": "QueryExistsRequest check if provided query exists or not." - }, - "v1QueryExistsResponse": { - "type": "object", - "properties": { - "exists": { - "type": "boolean" - } - }, - "description": "QueryExistsResponse returns true if query exists." - }, - "v1ReportMapFieldEntry": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "description": "ReportMapFieldEntry allows to pass labels/dimentions in form like {\"server\": [\"db1\", \"db2\"...]}." - }, - "v1Row": { - "type": "object", - "properties": { - "rank": { - "type": "integer", - "format": "int64" - }, - "dimension": { - "type": "string" - }, - "database": { - "type": "string" - }, - "metrics": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/v1Metric" - } - }, - "sparkline": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Point" - } - }, - "fingerprint": { - "type": "string" - }, - "num_queries": { - "type": "integer", - "format": "int64" - }, - "qps": { - "type": "number", - "format": "float" - }, - "load": { - "type": "number", - "format": "float" - } - }, - "description": "Row define metrics for selected dimention." - }, - "v1SchemaByQueryIDRequest": { - "type": "object", - "properties": { - "service_id": { - "type": "string" - }, - "query_id": { - "type": "string" - } - }, - "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID." - }, - "v1SchemaByQueryIDResponse": { - "type": "object", - "properties": { - "schema": { - "type": "string" - } - }, - "description": "SchemaByQueryIDResponse is schema for given query ID and service ID." - }, - "v1Stat": { - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float" - }, - "cnt": { - "type": "number", - "format": "float" - }, - "sum": { - "type": "number", - "format": "float" - }, - "min": { - "type": "number", - "format": "float" - }, - "max": { - "type": "number", - "format": "float" - }, - "p99": { - "type": "number", - "format": "float" - }, - "avg": { - "type": "number", - "format": "float" - }, - "sum_per_sec": { - "type": "number", - "format": "float" - } - }, - "description": "Stat is statistics of specific metric." - }, - "v1Values": { - "type": "object", - "properties": { - "value": { - "type": "string" - }, - "main_metric_percent": { - "type": "number", - "format": "float" - }, - "main_metric_per_sec": { - "type": "number", - "format": "float" - } - }, - "description": "Values is label values and main metric percent and per second." - } - } -} diff --git a/api/qan/v1/service_grpc.pb.go b/api/qan/v1/service_grpc.pb.go index 752a91653a0..d96a6d9d45c 100644 --- a/api/qan/v1/service_grpc.pb.go +++ b/api/qan/v1/service_grpc.pb.go @@ -8,6 +8,7 @@ package qanv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -236,36 +237,47 @@ type UnimplementedQANServiceServer struct{} func (UnimplementedQANServiceServer) GetReport(context.Context, *GetReportRequest) (*GetReportResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetReport not implemented") } + func (UnimplementedQANServiceServer) GetFilteredMetricsNames(context.Context, *GetFilteredMetricsNamesRequest) (*GetFilteredMetricsNamesResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetFilteredMetricsNames not implemented") } + func (UnimplementedQANServiceServer) GetMetricsNames(context.Context, *GetMetricsNamesRequest) (*GetMetricsNamesResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetMetricsNames not implemented") } + func (UnimplementedQANServiceServer) GetMetrics(context.Context, *GetMetricsRequest) (*GetMetricsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetMetrics not implemented") } + func (UnimplementedQANServiceServer) GetLabels(context.Context, *GetLabelsRequest) (*GetLabelsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetLabels not implemented") } + func (UnimplementedQANServiceServer) GetHistogram(context.Context, *GetHistogramRequest) (*GetHistogramResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetHistogram not implemented") } + func (UnimplementedQANServiceServer) ExplainFingerprintByQueryID(context.Context, *ExplainFingerprintByQueryIDRequest) (*ExplainFingerprintByQueryIDResponse, error) { return nil, status.Error(codes.Unimplemented, "method ExplainFingerprintByQueryID not implemented") } + func (UnimplementedQANServiceServer) GetQueryPlan(context.Context, *GetQueryPlanRequest) (*GetQueryPlanResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetQueryPlan not implemented") } + func (UnimplementedQANServiceServer) QueryExists(context.Context, *QueryExistsRequest) (*QueryExistsResponse, error) { return nil, status.Error(codes.Unimplemented, "method QueryExists not implemented") } + func (UnimplementedQANServiceServer) SchemaByQueryID(context.Context, *SchemaByQueryIDRequest) (*SchemaByQueryIDResponse, error) { return nil, status.Error(codes.Unimplemented, "method SchemaByQueryID not implemented") } + func (UnimplementedQANServiceServer) GetQueryExample(context.Context, *GetQueryExampleRequest) (*GetQueryExampleResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetQueryExample not implemented") } + func (UnimplementedQANServiceServer) HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { return nil, status.Error(codes.Unimplemented, "method HealthCheck not implemented") } diff --git a/api/realtimeanalytics/v1/collector.pb.go b/api/realtimeanalytics/v1/collector.pb.go index 8bb47bf7612..f149de0a6cf 100644 --- a/api/realtimeanalytics/v1/collector.pb.go +++ b/api/realtimeanalytics/v1/collector.pb.go @@ -7,12 +7,13 @@ package realtimeanalyticsv1 import ( - _ "google.golang.org/genproto/googleapis/api/visibility" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + _ "google.golang.org/genproto/googleapis/api/visibility" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -131,12 +132,15 @@ func file_realtimeanalytics_v1_collector_proto_rawDescGZIP() []byte { return file_realtimeanalytics_v1_collector_proto_rawDescData } -var file_realtimeanalytics_v1_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_realtimeanalytics_v1_collector_proto_goTypes = []any{ - (*CollectRequest)(nil), // 0: realtimeanalytics.v1.CollectRequest - (*CollectResponse)(nil), // 1: realtimeanalytics.v1.CollectResponse - (*QueryData)(nil), // 2: realtimeanalytics.v1.QueryData -} +var ( + file_realtimeanalytics_v1_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 2) + file_realtimeanalytics_v1_collector_proto_goTypes = []any{ + (*CollectRequest)(nil), // 0: realtimeanalytics.v1.CollectRequest + (*CollectResponse)(nil), // 1: realtimeanalytics.v1.CollectResponse + (*QueryData)(nil), // 2: realtimeanalytics.v1.QueryData + } +) + var file_realtimeanalytics_v1_collector_proto_depIdxs = []int32{ 2, // 0: realtimeanalytics.v1.CollectRequest.queries:type_name -> realtimeanalytics.v1.QueryData 0, // 1: realtimeanalytics.v1.CollectorService.Collect:input_type -> realtimeanalytics.v1.CollectRequest diff --git a/api/realtimeanalytics/v1/collector.swagger.json b/api/realtimeanalytics/v1/collector.swagger.json deleted file mode 100644 index 0216a29e22a..00000000000 --- a/api/realtimeanalytics/v1/collector.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "realtimeanalytics/v1/collector.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/realtimeanalytics/v1/collector_grpc.pb.go b/api/realtimeanalytics/v1/collector_grpc.pb.go index 7bd50b8144c..738bc9985e9 100644 --- a/api/realtimeanalytics/v1/collector_grpc.pb.go +++ b/api/realtimeanalytics/v1/collector_grpc.pb.go @@ -8,6 +8,7 @@ package realtimeanalyticsv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/realtimeanalytics/v1/query.pb.go b/api/realtimeanalytics/v1/query.pb.go index d2c537c1744..6d3f2df71da 100644 --- a/api/realtimeanalytics/v1/query.pb.go +++ b/api/realtimeanalytics/v1/query.pb.go @@ -7,13 +7,14 @@ package realtimeanalyticsv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" ) const ( @@ -319,13 +320,16 @@ func file_realtimeanalytics_v1_query_proto_rawDescGZIP() []byte { return file_realtimeanalytics_v1_query_proto_rawDescData } -var file_realtimeanalytics_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_realtimeanalytics_v1_query_proto_goTypes = []any{ - (*QueryMongoDBData)(nil), // 0: realtimeanalytics.v1.QueryMongoDBData - (*QueryData)(nil), // 1: realtimeanalytics.v1.QueryData - (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 3: google.protobuf.Duration -} +var ( + file_realtimeanalytics_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) + file_realtimeanalytics_v1_query_proto_goTypes = []any{ + (*QueryMongoDBData)(nil), // 0: realtimeanalytics.v1.QueryMongoDBData + (*QueryData)(nil), // 1: realtimeanalytics.v1.QueryData + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 3: google.protobuf.Duration + } +) + var file_realtimeanalytics_v1_query_proto_depIdxs = []int32{ 2, // 0: realtimeanalytics.v1.QueryMongoDBData.operation_start_time:type_name -> google.protobuf.Timestamp 3, // 1: realtimeanalytics.v1.QueryData.query_execution_duration:type_name -> google.protobuf.Duration diff --git a/api/realtimeanalytics/v1/query.swagger.json b/api/realtimeanalytics/v1/query.swagger.json deleted file mode 100644 index 6a628f444b1..00000000000 --- a/api/realtimeanalytics/v1/query.swagger.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "realtimeanalytics/v1/query.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/realtimeanalytics/v1/realtimeanalytics.pb.go b/api/realtimeanalytics/v1/realtimeanalytics.pb.go index 1d1b609979f..9aaf7797747 100644 --- a/api/realtimeanalytics/v1/realtimeanalytics.pb.go +++ b/api/realtimeanalytics/v1/realtimeanalytics.pb.go @@ -7,17 +7,19 @@ package realtimeanalyticsv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - v1 "github.com/percona/pmm/api/inventory/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" + + v1 "github.com/percona/pmm/api/inventory/v1" ) const ( @@ -693,27 +695,30 @@ func file_realtimeanalytics_v1_realtimeanalytics_proto_rawDescGZIP() []byte { return file_realtimeanalytics_v1_realtimeanalytics_proto_rawDescData } -var file_realtimeanalytics_v1_realtimeanalytics_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_realtimeanalytics_v1_realtimeanalytics_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_realtimeanalytics_v1_realtimeanalytics_proto_goTypes = []any{ - (SessionStatus)(0), // 0: realtimeanalytics.v1.SessionStatus - (*ListServicesRequest)(nil), // 1: realtimeanalytics.v1.ListServicesRequest - (*ListServicesResponse)(nil), // 2: realtimeanalytics.v1.ListServicesResponse - (*Session)(nil), // 3: realtimeanalytics.v1.Session - (*ListSessionsRequest)(nil), // 4: realtimeanalytics.v1.ListSessionsRequest - (*ListSessionsResponse)(nil), // 5: realtimeanalytics.v1.ListSessionsResponse - (*StartSessionRequest)(nil), // 6: realtimeanalytics.v1.StartSessionRequest - (*StartSessionResponse)(nil), // 7: realtimeanalytics.v1.StartSessionResponse - (*StopSessionRequest)(nil), // 8: realtimeanalytics.v1.StopSessionRequest - (*StopSessionResponse)(nil), // 9: realtimeanalytics.v1.StopSessionResponse - (*SearchQueriesRequest)(nil), // 10: realtimeanalytics.v1.SearchQueriesRequest - (*SearchQueriesResponse)(nil), // 11: realtimeanalytics.v1.SearchQueriesResponse - (v1.ServiceType)(0), // 12: inventory.v1.ServiceType - (*v1.MongoDBService)(nil), // 13: inventory.v1.MongoDBService - (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 15: google.protobuf.Duration - (*QueryData)(nil), // 16: realtimeanalytics.v1.QueryData -} +var ( + file_realtimeanalytics_v1_realtimeanalytics_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_realtimeanalytics_v1_realtimeanalytics_proto_msgTypes = make([]protoimpl.MessageInfo, 11) + file_realtimeanalytics_v1_realtimeanalytics_proto_goTypes = []any{ + (SessionStatus)(0), // 0: realtimeanalytics.v1.SessionStatus + (*ListServicesRequest)(nil), // 1: realtimeanalytics.v1.ListServicesRequest + (*ListServicesResponse)(nil), // 2: realtimeanalytics.v1.ListServicesResponse + (*Session)(nil), // 3: realtimeanalytics.v1.Session + (*ListSessionsRequest)(nil), // 4: realtimeanalytics.v1.ListSessionsRequest + (*ListSessionsResponse)(nil), // 5: realtimeanalytics.v1.ListSessionsResponse + (*StartSessionRequest)(nil), // 6: realtimeanalytics.v1.StartSessionRequest + (*StartSessionResponse)(nil), // 7: realtimeanalytics.v1.StartSessionResponse + (*StopSessionRequest)(nil), // 8: realtimeanalytics.v1.StopSessionRequest + (*StopSessionResponse)(nil), // 9: realtimeanalytics.v1.StopSessionResponse + (*SearchQueriesRequest)(nil), // 10: realtimeanalytics.v1.SearchQueriesRequest + (*SearchQueriesResponse)(nil), // 11: realtimeanalytics.v1.SearchQueriesResponse + (v1.ServiceType)(0), // 12: inventory.v1.ServiceType + (*v1.MongoDBService)(nil), // 13: inventory.v1.MongoDBService + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 15: google.protobuf.Duration + (*QueryData)(nil), // 16: realtimeanalytics.v1.QueryData + } +) + var file_realtimeanalytics_v1_realtimeanalytics_proto_depIdxs = []int32{ 12, // 0: realtimeanalytics.v1.ListServicesRequest.service_type:type_name -> inventory.v1.ServiceType 13, // 1: realtimeanalytics.v1.ListServicesResponse.mongodb:type_name -> inventory.v1.MongoDBService diff --git a/api/realtimeanalytics/v1/realtimeanalytics.swagger.json b/api/realtimeanalytics/v1/realtimeanalytics.swagger.json deleted file mode 100644 index 59d45b36d7a..00000000000 --- a/api/realtimeanalytics/v1/realtimeanalytics.swagger.json +++ /dev/null @@ -1,516 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "realtimeanalytics/v1/realtimeanalytics.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "RealtimeAnalyticsService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/realtimeanalytics/queries:search": { - "post": { - "summary": "List Running Database Queries in a particular services", - "description": "Returns list of currently running Database queries in a particular services", - "operationId": "SearchQueries", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1SearchQueriesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "SearchQueriesRequest contains optional filters for listing active Real-Time Analytics session Queries.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1SearchQueriesRequest" - } - } - ], - "tags": [ - "RealtimeAnalyticsService" - ] - } - }, - "/v1/realtimeanalytics/services": { - "get": { - "summary": "List Services that support Real-Time Analytics", - "description": "Returns a list of Services that support Real-Time Analytics filtered by type.", - "operationId": "ListServices", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListServicesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "service_type", - "description": "Return only services filtered by service type.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "SERVICE_TYPE_UNSPECIFIED", - "SERVICE_TYPE_MYSQL_SERVICE", - "SERVICE_TYPE_MONGODB_SERVICE", - "SERVICE_TYPE_POSTGRESQL_SERVICE", - "SERVICE_TYPE_VALKEY_SERVICE", - "SERVICE_TYPE_PROXYSQL_SERVICE", - "SERVICE_TYPE_HAPROXY_SERVICE", - "SERVICE_TYPE_EXTERNAL_SERVICE" - ], - "default": "SERVICE_TYPE_UNSPECIFIED" - } - ], - "tags": [ - "RealtimeAnalyticsService" - ] - } - }, - "/v1/realtimeanalytics/sessions": { - "get": { - "summary": "List Running Real-Time Analytics Sessions", - "description": "Returns the list of all currently running Real-Time Analytics sessions with their details including service, cluster and status information.", - "operationId": "ListSessions", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListSessionsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "cluster_name", - "description": "Optional filter by cluster name.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "RealtimeAnalyticsService" - ] - } - }, - "/v1/realtimeanalytics/sessions:start": { - "post": { - "summary": "Start Real-Time Analytics session", - "description": "Start Real-Time Analytics session for a specified service.", - "operationId": "StartSession", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1StartSessionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "StartSessionRequest contains parameters for starting Real-Time Analytics session.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1StartSessionRequest" - } - } - ], - "tags": [ - "RealtimeAnalyticsService" - ] - } - }, - "/v1/realtimeanalytics/sessions:stop": { - "post": { - "summary": "Stop Real-Time Analytics session", - "description": "Stop Real-Time Analytics session for a specified service.", - "operationId": "StopSession", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1StopSessionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "StopSessionRequest contains parameters for stopping Real-Time Analytics session.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1StopSessionRequest" - } - } - ], - "tags": [ - "RealtimeAnalyticsService" - ] - } - } - }, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1ListServicesResponse": { - "type": "object", - "properties": { - "mongodb": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1MongoDBService" - } - } - } - }, - "v1ListSessionsResponse": { - "type": "object", - "properties": { - "sessions": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Session" - }, - "description": "List of active Real-Time Analytics Sessions." - } - }, - "description": "ListSessionsResponse returns the list of currently active Real-Time Analytics Sessions." - }, - "v1MongoDBService": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Unique randomly generated instance identifier." - }, - "service_name": { - "type": "string", - "description": "Unique across all Services user-defined name." - }, - "node_id": { - "type": "string", - "description": "Node identifier where this instance runs." - }, - "address": { - "type": "string", - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "Access port.\nPort is required when the address present." - }, - "socket": { - "type": "string", - "description": "Access unix socket.\nAddress (and port) or socket is required." - }, - "environment": { - "type": "string", - "description": "Environment name." - }, - "cluster": { - "type": "string", - "description": "Cluster name." - }, - "replication_set": { - "type": "string", - "description": "Replication set name." - }, - "custom_labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom user-assigned labels." - }, - "version": { - "type": "string", - "description": "MongoDB version." - } - }, - "description": "MongoDBService represents a generic MongoDB instance." - }, - "v1QueryData": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "PMM Service identifier that reported the query." - }, - "service_name": { - "type": "string", - "description": "PMM Service name that reported the query." - }, - "query_id": { - "type": "string", - "description": "Unique identifier for the query." - }, - "query_text": { - "type": "string", - "description": "The text of the query." - }, - "query_raw_json": { - "type": "string", - "description": "Raw JSON representation of the query." - }, - "query_execution_duration": { - "type": "string", - "description": "Current query current execution time." - }, - "query_collect_time": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the query data was collected by Real-Time Analytics agent." - }, - "client_address": { - "type": "string", - "description": "Client address (host:port)." - }, - "mongo_db_payload": { - "$ref": "#/definitions/v1QueryMongoDBData", - "description": "MongoDB-specific query data." - } - }, - "description": "QueryData represents a single Real-Time Analytics query data point.\nIt includes general query information and a payload for database-specific details." - }, - "v1QueryMongoDBData": { - "type": "object", - "properties": { - "db_instance_address": { - "type": "string", - "description": "MongoDB instance address(host:port) that processing the query." - }, - "client_app_name": { - "type": "string", - "description": "Client application name from the MongoDB query." - }, - "database_name": { - "type": "string", - "description": "Database name." - }, - "collection": { - "type": "string", - "description": "Collection name." - }, - "operation": { - "type": "string", - "description": "Query operation (\"find\", \"aggregate\", \"update\", etc)." - }, - "operation_start_time": { - "type": "string", - "format": "date-time", - "description": "The start time of the operation." - }, - "username": { - "type": "string", - "description": "MongoDB user name associated with the query." - }, - "plan_summary": { - "type": "string", - "description": "Indicates if an index (COLLSCAN vs IXSCAN) was utilized in the query." - } - }, - "description": "QueryMongoDBData holds MongoDB-specific Real-Time Analytics query information." - }, - "v1SearchQueriesRequest": { - "type": "object", - "properties": { - "service_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Optional filter by Service identifiers." - }, - "limit": { - "type": "string", - "format": "int64", - "description": "Optional limit the number of queries in response." - } - }, - "description": "SearchQueriesRequest contains optional filters for listing active Real-Time Analytics session Queries." - }, - "v1SearchQueriesResponse": { - "type": "object", - "properties": { - "queries": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1QueryData" - }, - "description": "List of active Real-Time Analytics session Queries." - } - }, - "description": "SearchQueriesResponse returns the list of currently active Real-Time Analytics session Queries." - }, - "v1ServiceType": { - "type": "string", - "enum": [ - "SERVICE_TYPE_UNSPECIFIED", - "SERVICE_TYPE_MYSQL_SERVICE", - "SERVICE_TYPE_MONGODB_SERVICE", - "SERVICE_TYPE_POSTGRESQL_SERVICE", - "SERVICE_TYPE_VALKEY_SERVICE", - "SERVICE_TYPE_PROXYSQL_SERVICE", - "SERVICE_TYPE_HAPROXY_SERVICE", - "SERVICE_TYPE_EXTERNAL_SERVICE" - ], - "default": "SERVICE_TYPE_UNSPECIFIED", - "description": "ServiceType describes supported Service types." - }, - "v1Session": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Service identifier that has enabled Real-Time Analytics session." - }, - "service_name": { - "type": "string", - "description": "Service name." - }, - "cluster_name": { - "type": "string", - "description": "Cluster name the service belongs to." - }, - "start_time": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the Real-Time Analytics session started." - }, - "collect_interval": { - "type": "string", - "description": "Query collect interval." - }, - "status": { - "$ref": "#/definitions/v1SessionStatus", - "description": "Current status of the Real-Time Analytics session." - } - }, - "description": "Session represents an active Real-Time Analytics session." - }, - "v1SessionStatus": { - "type": "string", - "enum": [ - "SESSION_STATUS_UNSPECIFIED", - "SESSION_STATUS_ERROR", - "SESSION_STATUS_RUNNING", - "SESSION_STATUS_DOWN" - ], - "default": "SESSION_STATUS_UNSPECIFIED", - "description": "Status represents actual Real-Time Analytics session status.\n\n - SESSION_STATUS_ERROR: Session encountered an error.\n - SESSION_STATUS_RUNNING: Session is running.\n - SESSION_STATUS_DOWN: Session has been stopped or disabled." - }, - "v1StartSessionRequest": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Required service identifier the Real-Time Analytics session shall be started for." - } - }, - "description": "StartSessionRequest contains parameters for starting Real-Time Analytics session." - }, - "v1StartSessionResponse": { - "type": "object", - "properties": { - "session": { - "$ref": "#/definitions/v1Session" - } - }, - "description": "StartSessionResponse is the response for starting Real-Time Analytics session." - }, - "v1StopSessionRequest": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "description": "Required service identifier the Real-Time Analytics session shall be stopped for." - } - }, - "description": "StopSessionRequest contains parameters for stopping Real-Time Analytics session." - }, - "v1StopSessionResponse": { - "type": "object", - "description": "StopSessionResponse is the response for stopping Real-Time Analytics session.\n\nEmpty response for now." - } - } -} diff --git a/api/realtimeanalytics/v1/realtimeanalytics_grpc.pb.go b/api/realtimeanalytics/v1/realtimeanalytics_grpc.pb.go index 730891f4d8d..0d389f33d03 100644 --- a/api/realtimeanalytics/v1/realtimeanalytics_grpc.pb.go +++ b/api/realtimeanalytics/v1/realtimeanalytics_grpc.pb.go @@ -8,6 +8,7 @@ package realtimeanalyticsv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -131,18 +132,23 @@ type UnimplementedRealtimeAnalyticsServiceServer struct{} func (UnimplementedRealtimeAnalyticsServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListServices not implemented") } + func (UnimplementedRealtimeAnalyticsServiceServer) ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListSessions not implemented") } + func (UnimplementedRealtimeAnalyticsServiceServer) StartSession(context.Context, *StartSessionRequest) (*StartSessionResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartSession not implemented") } + func (UnimplementedRealtimeAnalyticsServiceServer) StopSession(context.Context, *StopSessionRequest) (*StopSessionResponse, error) { return nil, status.Error(codes.Unimplemented, "method StopSession not implemented") } + func (UnimplementedRealtimeAnalyticsServiceServer) SearchQueries(context.Context, *SearchQueriesRequest) (*SearchQueriesResponse, error) { return nil, status.Error(codes.Unimplemented, "method SearchQueries not implemented") } + func (UnimplementedRealtimeAnalyticsServiceServer) mustEmbedUnimplementedRealtimeAnalyticsServiceServer() { } func (UnimplementedRealtimeAnalyticsServiceServer) testEmbeddedByValue() {} diff --git a/api/server/v1/httperror.pb.go b/api/server/v1/httperror.pb.go index a71c3b4f133..8778ad26272 100644 --- a/api/server/v1/httperror.pb.go +++ b/api/server/v1/httperror.pb.go @@ -7,12 +7,13 @@ package serverv1 import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" ) const ( @@ -119,11 +120,14 @@ func file_server_v1_httperror_proto_rawDescGZIP() []byte { return file_server_v1_httperror_proto_rawDescData } -var file_server_v1_httperror_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_server_v1_httperror_proto_goTypes = []any{ - (*HttpError)(nil), // 0: server.v1.HttpError - (*anypb.Any)(nil), // 1: google.protobuf.Any -} +var ( + file_server_v1_httperror_proto_msgTypes = make([]protoimpl.MessageInfo, 1) + file_server_v1_httperror_proto_goTypes = []any{ + (*HttpError)(nil), // 0: server.v1.HttpError + (*anypb.Any)(nil), // 1: google.protobuf.Any + } +) + var file_server_v1_httperror_proto_depIdxs = []int32{ 1, // 0: server.v1.HttpError.details:type_name -> google.protobuf.Any 1, // [1:1] is the sub-list for method output_type diff --git a/api/server/v1/httperror.swagger.json b/api/server/v1/httperror.swagger.json deleted file mode 100644 index 7462173f0ff..00000000000 --- a/api/server/v1/httperror.swagger.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "server/v1/httperror.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - } - }, - "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/api/server/v1/server.pb.go b/api/server/v1/server.pb.go index 0012d4e039d..07eca02946e 100644 --- a/api/server/v1/server.pb.go +++ b/api/server/v1/server.pb.go @@ -7,16 +7,18 @@ package serverv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - common "github.com/percona/pmm/api/common" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" + + common "github.com/percona/pmm/api/common" ) const ( @@ -1913,40 +1915,43 @@ func file_server_v1_server_proto_rawDescGZIP() []byte { return file_server_v1_server_proto_rawDescData } -var file_server_v1_server_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_server_v1_server_proto_msgTypes = make([]protoimpl.MessageInfo, 26) -var file_server_v1_server_proto_goTypes = []any{ - (DistributionMethod)(0), // 0: server.v1.DistributionMethod - (*VersionInfo)(nil), // 1: server.v1.VersionInfo - (*VersionRequest)(nil), // 2: server.v1.VersionRequest - (*VersionResponse)(nil), // 3: server.v1.VersionResponse - (*ReadinessRequest)(nil), // 4: server.v1.ReadinessRequest - (*ReadinessResponse)(nil), // 5: server.v1.ReadinessResponse - (*LeaderHealthCheckRequest)(nil), // 6: server.v1.LeaderHealthCheckRequest - (*LeaderHealthCheckResponse)(nil), // 7: server.v1.LeaderHealthCheckResponse - (*CheckUpdatesRequest)(nil), // 8: server.v1.CheckUpdatesRequest - (*DockerVersionInfo)(nil), // 9: server.v1.DockerVersionInfo - (*CheckUpdatesResponse)(nil), // 10: server.v1.CheckUpdatesResponse - (*ListChangeLogsRequest)(nil), // 11: server.v1.ListChangeLogsRequest - (*ListChangeLogsResponse)(nil), // 12: server.v1.ListChangeLogsResponse - (*StartUpdateRequest)(nil), // 13: server.v1.StartUpdateRequest - (*StartUpdateResponse)(nil), // 14: server.v1.StartUpdateResponse - (*UpdateStatusRequest)(nil), // 15: server.v1.UpdateStatusRequest - (*UpdateStatusResponse)(nil), // 16: server.v1.UpdateStatusResponse - (*MetricsResolutions)(nil), // 17: server.v1.MetricsResolutions - (*AdvisorRunIntervals)(nil), // 18: server.v1.AdvisorRunIntervals - (*Settings)(nil), // 19: server.v1.Settings - (*ReadOnlySettings)(nil), // 20: server.v1.ReadOnlySettings - (*GetSettingsRequest)(nil), // 21: server.v1.GetSettingsRequest - (*GetReadOnlySettingsRequest)(nil), // 22: server.v1.GetReadOnlySettingsRequest - (*GetSettingsResponse)(nil), // 23: server.v1.GetSettingsResponse - (*GetReadOnlySettingsResponse)(nil), // 24: server.v1.GetReadOnlySettingsResponse - (*ChangeSettingsRequest)(nil), // 25: server.v1.ChangeSettingsRequest - (*ChangeSettingsResponse)(nil), // 26: server.v1.ChangeSettingsResponse - (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 28: google.protobuf.Duration - (*common.StringArray)(nil), // 29: common.StringArray -} +var ( + file_server_v1_server_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_server_v1_server_proto_msgTypes = make([]protoimpl.MessageInfo, 26) + file_server_v1_server_proto_goTypes = []any{ + (DistributionMethod)(0), // 0: server.v1.DistributionMethod + (*VersionInfo)(nil), // 1: server.v1.VersionInfo + (*VersionRequest)(nil), // 2: server.v1.VersionRequest + (*VersionResponse)(nil), // 3: server.v1.VersionResponse + (*ReadinessRequest)(nil), // 4: server.v1.ReadinessRequest + (*ReadinessResponse)(nil), // 5: server.v1.ReadinessResponse + (*LeaderHealthCheckRequest)(nil), // 6: server.v1.LeaderHealthCheckRequest + (*LeaderHealthCheckResponse)(nil), // 7: server.v1.LeaderHealthCheckResponse + (*CheckUpdatesRequest)(nil), // 8: server.v1.CheckUpdatesRequest + (*DockerVersionInfo)(nil), // 9: server.v1.DockerVersionInfo + (*CheckUpdatesResponse)(nil), // 10: server.v1.CheckUpdatesResponse + (*ListChangeLogsRequest)(nil), // 11: server.v1.ListChangeLogsRequest + (*ListChangeLogsResponse)(nil), // 12: server.v1.ListChangeLogsResponse + (*StartUpdateRequest)(nil), // 13: server.v1.StartUpdateRequest + (*StartUpdateResponse)(nil), // 14: server.v1.StartUpdateResponse + (*UpdateStatusRequest)(nil), // 15: server.v1.UpdateStatusRequest + (*UpdateStatusResponse)(nil), // 16: server.v1.UpdateStatusResponse + (*MetricsResolutions)(nil), // 17: server.v1.MetricsResolutions + (*AdvisorRunIntervals)(nil), // 18: server.v1.AdvisorRunIntervals + (*Settings)(nil), // 19: server.v1.Settings + (*ReadOnlySettings)(nil), // 20: server.v1.ReadOnlySettings + (*GetSettingsRequest)(nil), // 21: server.v1.GetSettingsRequest + (*GetReadOnlySettingsRequest)(nil), // 22: server.v1.GetReadOnlySettingsRequest + (*GetSettingsResponse)(nil), // 23: server.v1.GetSettingsResponse + (*GetReadOnlySettingsResponse)(nil), // 24: server.v1.GetReadOnlySettingsResponse + (*ChangeSettingsRequest)(nil), // 25: server.v1.ChangeSettingsRequest + (*ChangeSettingsResponse)(nil), // 26: server.v1.ChangeSettingsResponse + (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 28: google.protobuf.Duration + (*common.StringArray)(nil), // 29: common.StringArray + } +) + var file_server_v1_server_proto_depIdxs = []int32{ 27, // 0: server.v1.VersionInfo.timestamp:type_name -> google.protobuf.Timestamp 1, // 1: server.v1.VersionResponse.server:type_name -> server.v1.VersionInfo diff --git a/api/server/v1/server.pb.validate.go b/api/server/v1/server.pb.validate.go index dd94f1823e5..f684fea246b 100644 --- a/api/server/v1/server.pb.validate.go +++ b/api/server/v1/server.pb.validate.go @@ -3317,7 +3317,6 @@ func (m *ChangeSettingsRequest) validate(all bool) error { } if m.AwsPartitions != nil { - if all { switch v := interface{}(m.GetAwsPartitions()).(type) { case interface{ ValidateAll() error }: @@ -3346,7 +3345,6 @@ func (m *ChangeSettingsRequest) validate(all bool) error { } } } - } if m.EnableAdvisor != nil { diff --git a/api/server/v1/server.swagger.json b/api/server/v1/server.swagger.json deleted file mode 100644 index d8ea983f495..00000000000 --- a/api/server/v1/server.swagger.json +++ /dev/null @@ -1,798 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "server/v1/server.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "ServerService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/server/leaderHealthCheck": { - "get": { - "summary": "Check Leadership", - "description": "Checks if the instance is the leader in a cluster. Returns an error if the instance isn't the leader.", - "operationId": "LeaderHealthCheck", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1LeaderHealthCheckResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "ServerService" - ] - } - }, - "/v1/server/readyz": { - "get": { - "summary": "Check server readiness", - "description": "Returns an error when Server components being restarted are not ready yet. Use this API for checking the health of Docker containers and for probing Kubernetes readiness.", - "operationId": "Readiness", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ReadinessResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "ServerService" - ] - } - }, - "/v1/server/settings": { - "get": { - "summary": "Get settings", - "description": "Returns current PMM Server settings.", - "operationId": "GetSettings", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetSettingsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "ServerService" - ] - }, - "put": { - "summary": "Change settings", - "description": "Changes PMM Server settings.", - "operationId": "ChangeSettings", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ChangeSettingsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1ChangeSettingsRequest" - } - } - ], - "tags": [ - "ServerService" - ] - } - }, - "/v1/server/settings/readonly": { - "get": { - "summary": "Get read-only settings", - "description": "Returns a stripped version of PMM Server settings.", - "operationId": "GetReadOnlySettings", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetReadOnlySettingsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "ServerService" - ] - } - }, - "/v1/server/updates": { - "get": { - "summary": "Check updates", - "description": "Checks for available PMM Server updates.", - "operationId": "CheckUpdates", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1CheckUpdatesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "force", - "description": "If false, cached information may be returned.", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "only_installed_version", - "description": "If true, only installed version will be in response.", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "tags": [ - "ServerService" - ] - } - }, - "/v1/server/updates/changelogs": { - "get": { - "summary": "Get the changelog", - "description": "Display a changelog comparing the installed version to the latest available version.", - "operationId": "ListChangeLogs", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListChangeLogsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "ServerService" - ] - } - }, - "/v1/server/updates:getStatus": { - "post": { - "summary": "Update status", - "description": "Returns PMM Server update status.", - "operationId": "UpdateStatus", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UpdateStatusResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1UpdateStatusRequest" - } - } - ], - "tags": [ - "ServerService" - ] - } - }, - "/v1/server/updates:start": { - "post": { - "summary": "Start update", - "description": "Starts PMM Server update.", - "operationId": "StartUpdate", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1StartUpdateResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1StartUpdateRequest" - } - } - ], - "tags": [ - "ServerService" - ] - } - }, - "/v1/server/version": { - "get": { - "summary": "Version", - "description": "Returns PMM Server versions.", - "operationId": "Version", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1VersionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "dummy", - "description": "Dummy parameter for internal testing. Do not use.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "ServerService" - ] - } - } - }, - "definitions": { - "commonStringArray": { - "type": "object", - "properties": { - "values": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "description": "A wrapper for a string array. This type allows to distinguish between an empty array and a null value." - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - } - }, - "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1AdvisorRunIntervals": { - "type": "object", - "properties": { - "standard_interval": { - "type": "string", - "description": "Standard check interval." - }, - "rare_interval": { - "type": "string", - "description": "Interval for rare check runs." - }, - "frequent_interval": { - "type": "string", - "description": "Interval for frequent check runs." - } - }, - "description": "AdvisorRunIntervals represents intervals between each run of Advisor checks." - }, - "v1ChangeSettingsRequest": { - "type": "object", - "properties": { - "enable_updates": { - "type": "boolean", - "x-nullable": true - }, - "enable_telemetry": { - "type": "boolean", - "x-nullable": true - }, - "metrics_resolutions": { - "$ref": "#/definitions/v1MetricsResolutions" - }, - "data_retention": { - "type": "string", - "description": "A number of full days for Prometheus and QAN data retention. Should have a suffix in JSON: 2592000s, 43200m, 720h." - }, - "ssh_key": { - "type": "string", - "x-nullable": true - }, - "aws_partitions": { - "$ref": "#/definitions/commonStringArray", - "x-nullable": true - }, - "enable_advisor": { - "type": "boolean", - "x-nullable": true, - "description": "Enable Advisor." - }, - "enable_alerting": { - "type": "boolean", - "x-nullable": true, - "description": "Enable Alerting." - }, - "pmm_public_address": { - "type": "string", - "x-nullable": true, - "description": "PMM Server public address." - }, - "advisor_run_intervals": { - "$ref": "#/definitions/v1AdvisorRunIntervals", - "description": "Intervals between Advisor runs." - }, - "enable_azurediscover": { - "type": "boolean", - "x-nullable": true, - "description": "Enable Azure Discover." - }, - "enable_backup_management": { - "type": "boolean", - "x-nullable": true, - "description": "Enable Backup Management." - }, - "enable_access_control": { - "type": "boolean", - "x-nullable": true, - "title": "Enable Access Control" - }, - "enable_internal_pg_qan": { - "type": "boolean", - "x-nullable": true, - "description": "Enable Query Analytics for PMM's internal PG database." - }, - "update_snooze_duration": { - "type": "string", - "description": "A number of full days for which an update is snoozed, i.e. a multiple of 24h: 2592000s, 43200m, 720h." - } - } - }, - "v1ChangeSettingsResponse": { - "type": "object", - "properties": { - "settings": { - "$ref": "#/definitions/v1Settings" - } - } - }, - "v1CheckUpdatesResponse": { - "type": "object", - "properties": { - "installed": { - "$ref": "#/definitions/v1VersionInfo", - "description": "Currently installed PMM Server version." - }, - "latest": { - "$ref": "#/definitions/v1DockerVersionInfo", - "description": "Latest available PMM Server version." - }, - "update_available": { - "type": "boolean", - "description": "True if there is a PMM Server update available." - }, - "latest_news_url": { - "type": "string", - "description": "Latest available PMM Server release announcement URL." - }, - "last_check": { - "type": "string", - "format": "date-time", - "description": "Last check time." - } - } - }, - "v1DistributionMethod": { - "type": "string", - "enum": [ - "DISTRIBUTION_METHOD_UNSPECIFIED", - "DISTRIBUTION_METHOD_DOCKER", - "DISTRIBUTION_METHOD_OVF", - "DISTRIBUTION_METHOD_AMI", - "DISTRIBUTION_METHOD_AZURE", - "DISTRIBUTION_METHOD_DO" - ], - "default": "DISTRIBUTION_METHOD_UNSPECIFIED", - "description": "DistributionMethod defines PMM Server distribution method: Docker image, OVF/OVA, or AMI." - }, - "v1DockerVersionInfo": { - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "PMM Version." - }, - "tag": { - "type": "string", - "description": "Docker image tag." - }, - "timestamp": { - "type": "string", - "format": "date-time", - "description": "Release date." - }, - "release_notes_url": { - "type": "string", - "description": "Release notes URL for the version (if available)." - }, - "release_notes_text": { - "type": "string", - "description": "Release notes text for the version (if available)." - } - } - }, - "v1GetReadOnlySettingsResponse": { - "type": "object", - "properties": { - "settings": { - "$ref": "#/definitions/v1ReadOnlySettings" - } - } - }, - "v1GetSettingsResponse": { - "type": "object", - "properties": { - "settings": { - "$ref": "#/definitions/v1Settings" - } - } - }, - "v1LeaderHealthCheckResponse": { - "type": "object", - "description": "This probe is available without authentication, so it should not contain any data." - }, - "v1ListChangeLogsResponse": { - "type": "object", - "properties": { - "updates": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1DockerVersionInfo" - }, - "description": "List of available updates." - }, - "last_check": { - "type": "string", - "format": "date-time", - "description": "Last check time." - } - } - }, - "v1MetricsResolutions": { - "type": "object", - "properties": { - "hr": { - "type": "string", - "description": "High resolution. Should have a suffix in JSON: 1s, 1m, 1h." - }, - "mr": { - "type": "string", - "description": "Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h." - }, - "lr": { - "type": "string", - "description": "Low resolution. Should have a suffix in JSON: 1s, 1m, 1h." - } - }, - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions." - }, - "v1ReadOnlySettings": { - "type": "object", - "properties": { - "updates_enabled": { - "type": "boolean", - "description": "True if updates are enabled." - }, - "telemetry_enabled": { - "type": "boolean", - "description": "True if telemetry is enabled." - }, - "advisor_enabled": { - "type": "boolean", - "description": "True if Advisor is enabled." - }, - "alerting_enabled": { - "type": "boolean", - "description": "True if Alerting is enabled." - }, - "pmm_public_address": { - "type": "string", - "description": "PMM Server public address." - }, - "backup_management_enabled": { - "type": "boolean", - "description": "True if Backup Management is enabled." - }, - "azurediscover_enabled": { - "type": "boolean", - "description": "True if Azure Discover is enabled." - }, - "enable_access_control": { - "type": "boolean", - "description": "True if Access Control is enabled." - } - }, - "description": "ReadOnlySettings represents a stripped-down version of PMM Server settings that can be accessed by users of all roles." - }, - "v1ReadinessResponse": { - "type": "object", - "description": "This probe is available without authentication, so it should not contain any data." - }, - "v1Settings": { - "type": "object", - "properties": { - "updates_enabled": { - "type": "boolean", - "description": "True if updates are enabled." - }, - "telemetry_enabled": { - "type": "boolean", - "description": "True if telemetry is enabled." - }, - "metrics_resolutions": { - "$ref": "#/definitions/v1MetricsResolutions" - }, - "data_retention": { - "type": "string" - }, - "ssh_key": { - "type": "string" - }, - "aws_partitions": { - "type": "array", - "items": { - "type": "string" - } - }, - "advisor_enabled": { - "type": "boolean", - "description": "True if Advisor is enabled." - }, - "platform_email": { - "type": "string" - }, - "alerting_enabled": { - "type": "boolean", - "description": "True if Alerting is enabled." - }, - "pmm_public_address": { - "type": "string", - "description": "PMM Server public address." - }, - "advisor_run_intervals": { - "$ref": "#/definitions/v1AdvisorRunIntervals", - "description": "Intervals between Advisor runs." - }, - "backup_management_enabled": { - "type": "boolean", - "description": "True if Backup Management is enabled." - }, - "azurediscover_enabled": { - "type": "boolean", - "description": "True if Azure Discover is enabled." - }, - "connected_to_platform": { - "type": "boolean", - "title": "True if the PMM instance is connected to Platform" - }, - "telemetry_summaries": { - "type": "array", - "items": { - "type": "string" - }, - "title": "Includes list of collected telemetry" - }, - "enable_access_control": { - "type": "boolean", - "description": "True if Access Control is enabled." - }, - "default_role_id": { - "type": "integer", - "format": "int64", - "description": "Default Access Control role ID for new users." - }, - "enable_internal_pg_qan": { - "type": "boolean", - "description": "True if Query Analytics for PMM's internal PG database is enabled." - }, - "update_snooze_duration": { - "type": "string", - "title": "Duration for which an update is snoozed" - } - }, - "description": "Settings represents PMM Server settings." - }, - "v1StartUpdateRequest": { - "type": "object", - "properties": { - "new_image": { - "type": "string" - } - } - }, - "v1StartUpdateResponse": { - "type": "object", - "properties": { - "auth_token": { - "type": "string", - "description": "Authentication token for getting update statuses." - }, - "log_offset": { - "type": "integer", - "format": "int64", - "description": "Progress log offset." - } - } - }, - "v1UpdateStatusRequest": { - "type": "object", - "properties": { - "auth_token": { - "type": "string", - "description": "Authentication token." - }, - "log_offset": { - "type": "integer", - "format": "int64", - "description": "Progress log offset." - } - } - }, - "v1UpdateStatusResponse": { - "type": "object", - "properties": { - "log_lines": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Progress log lines." - }, - "log_offset": { - "type": "integer", - "format": "int64", - "description": "Progress log offset for the next request." - }, - "done": { - "type": "boolean", - "description": "True when update is done." - } - } - }, - "v1VersionInfo": { - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "User-visible version." - }, - "full_version": { - "type": "string", - "description": "Full version for debugging." - }, - "timestamp": { - "type": "string", - "format": "date-time", - "description": "Build or release date." - } - }, - "description": "VersionInfo describes component version, or PMM Server as a whole." - }, - "v1VersionResponse": { - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "PMM Server version." - }, - "server": { - "$ref": "#/definitions/v1VersionInfo", - "description": "Detailed PMM Server version information." - }, - "managed": { - "$ref": "#/definitions/v1VersionInfo", - "description": "pmm-managed version information for debugging." - }, - "distribution_method": { - "$ref": "#/definitions/v1DistributionMethod", - "description": "PMM Server distribution method.\n\nTODO Versions and statuses of Grafana, Prometheus, PostgreSQL, qan-api2, ClickHouse, pmm-agent, etc." - } - } - } - } -} diff --git a/api/server/v1/server_grpc.pb.go b/api/server/v1/server_grpc.pb.go index 145fe2a7a18..29719f730c8 100644 --- a/api/server/v1/server_grpc.pb.go +++ b/api/server/v1/server_grpc.pb.go @@ -8,6 +8,7 @@ package serverv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -208,30 +209,39 @@ type UnimplementedServerServiceServer struct{} func (UnimplementedServerServiceServer) Version(context.Context, *VersionRequest) (*VersionResponse, error) { return nil, status.Error(codes.Unimplemented, "method Version not implemented") } + func (UnimplementedServerServiceServer) Readiness(context.Context, *ReadinessRequest) (*ReadinessResponse, error) { return nil, status.Error(codes.Unimplemented, "method Readiness not implemented") } + func (UnimplementedServerServiceServer) LeaderHealthCheck(context.Context, *LeaderHealthCheckRequest) (*LeaderHealthCheckResponse, error) { return nil, status.Error(codes.Unimplemented, "method LeaderHealthCheck not implemented") } + func (UnimplementedServerServiceServer) CheckUpdates(context.Context, *CheckUpdatesRequest) (*CheckUpdatesResponse, error) { return nil, status.Error(codes.Unimplemented, "method CheckUpdates not implemented") } + func (UnimplementedServerServiceServer) ListChangeLogs(context.Context, *ListChangeLogsRequest) (*ListChangeLogsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListChangeLogs not implemented") } + func (UnimplementedServerServiceServer) StartUpdate(context.Context, *StartUpdateRequest) (*StartUpdateResponse, error) { return nil, status.Error(codes.Unimplemented, "method StartUpdate not implemented") } + func (UnimplementedServerServiceServer) UpdateStatus(context.Context, *UpdateStatusRequest) (*UpdateStatusResponse, error) { return nil, status.Error(codes.Unimplemented, "method UpdateStatus not implemented") } + func (UnimplementedServerServiceServer) GetSettings(context.Context, *GetSettingsRequest) (*GetSettingsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetSettings not implemented") } + func (UnimplementedServerServiceServer) GetReadOnlySettings(context.Context, *GetReadOnlySettingsRequest) (*GetReadOnlySettingsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetReadOnlySettings not implemented") } + func (UnimplementedServerServiceServer) ChangeSettings(context.Context, *ChangeSettingsRequest) (*ChangeSettingsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ChangeSettings not implemented") } diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json index 1ca1471e02b..d6503a73cb9 100644 --- a/api/swagger/swagger-dev.json +++ b/api/swagger/swagger-dev.json @@ -22681,6 +22681,100 @@ } } }, + "/v1/management/nodes:installToken": { + "post": { + "description": "Creates a short-lived Grafana service account token for PMM Client install.", + "tags": [ + "ManagementService" + ], + "summary": "Create Node Install Token", + "operationId": "CreateNodeInstallToken", + "parameters": [ + { + "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", + "type": "object", + "properties": { + "ttl_seconds": { + "description": "Token TTL in seconds; 0 means use server default. Server clamps to a maximum.", + "type": "integer", + "format": "int64", + "x-order": 0 + }, + "technology": { + "description": "Technology for install script TECH env (e.g. mysql, postgresql, mongodb).", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "description": "CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL.", + "type": "object", + "properties": { + "token": { + "description": "Plaintext token for PMM_SERVER_URL userinfo (service_token:\u003ctoken\u003e).", + "type": "string", + "x-order": 0 + }, + "expires_at": { + "description": "Expiration time of the token (derived from TTL).", + "type": "string", + "format": "date-time", + "x-order": 1 + }, + "service_account_id": { + "description": "Grafana service account id created for this install token flow.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + } + }, + "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": {} + }, + "x-order": 2 + } + } + } + } + } + } + }, "/v1/management/services": { "get": { "description": "Returns a filtered list of Services.", diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json index 6650f3b8266..578b3b0af13 100644 --- a/api/swagger/swagger.json +++ b/api/swagger/swagger.json @@ -21723,6 +21723,100 @@ } } }, + "/v1/management/nodes:installToken": { + "post": { + "description": "Creates a short-lived Grafana service account token for PMM Client install.", + "tags": [ + "ManagementService" + ], + "summary": "Create Node Install Token", + "operationId": "CreateNodeInstallToken", + "parameters": [ + { + "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", + "type": "object", + "properties": { + "ttl_seconds": { + "description": "Token TTL in seconds; 0 means use server default. Server clamps to a maximum.", + "type": "integer", + "format": "int64", + "x-order": 0 + }, + "technology": { + "description": "Technology for install script TECH env (e.g. mysql, postgresql, mongodb).", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "description": "CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL.", + "type": "object", + "properties": { + "token": { + "description": "Plaintext token for PMM_SERVER_URL userinfo (service_token:\u003ctoken\u003e).", + "type": "string", + "x-order": 0 + }, + "expires_at": { + "description": "Expiration time of the token (derived from TTL).", + "type": "string", + "format": "date-time", + "x-order": 1 + }, + "service_account_id": { + "description": "Grafana service account id created for this install token flow.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + } + }, + "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": {} + }, + "x-order": 2 + } + } + } + } + } + } + }, "/v1/management/services": { "get": { "description": "Returns a filtered list of Services.", diff --git a/api/uievents/v1/server.pb.go b/api/uievents/v1/server.pb.go index 6f3472d1deb..41d144b9c29 100644 --- a/api/uievents/v1/server.pb.go +++ b/api/uievents/v1/server.pb.go @@ -7,13 +7,14 @@ package uieventsv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" ) const ( @@ -467,16 +468,19 @@ func file_uievents_v1_server_proto_rawDescGZIP() []byte { return file_uievents_v1_server_proto_rawDescData } -var file_uievents_v1_server_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_uievents_v1_server_proto_goTypes = []any{ - (*NotificationEvent)(nil), // 0: uievents.v1.NotificationEvent - (*FetchingEvent)(nil), // 1: uievents.v1.FetchingEvent - (*DashboardUsageEvent)(nil), // 2: uievents.v1.DashboardUsageEvent - (*UserFlowEvent)(nil), // 3: uievents.v1.UserFlowEvent - (*StoreRequest)(nil), // 4: uievents.v1.StoreRequest - (*StoreResponse)(nil), // 5: uievents.v1.StoreResponse - nil, // 6: uievents.v1.UserFlowEvent.ParamsEntry -} +var ( + file_uievents_v1_server_proto_msgTypes = make([]protoimpl.MessageInfo, 7) + file_uievents_v1_server_proto_goTypes = []any{ + (*NotificationEvent)(nil), // 0: uievents.v1.NotificationEvent + (*FetchingEvent)(nil), // 1: uievents.v1.FetchingEvent + (*DashboardUsageEvent)(nil), // 2: uievents.v1.DashboardUsageEvent + (*UserFlowEvent)(nil), // 3: uievents.v1.UserFlowEvent + (*StoreRequest)(nil), // 4: uievents.v1.StoreRequest + (*StoreResponse)(nil), // 5: uievents.v1.StoreResponse + nil, // 6: uievents.v1.UserFlowEvent.ParamsEntry + } +) + var file_uievents_v1_server_proto_depIdxs = []int32{ 6, // 0: uievents.v1.UserFlowEvent.params:type_name -> uievents.v1.UserFlowEvent.ParamsEntry 0, // 1: uievents.v1.StoreRequest.notifications:type_name -> uievents.v1.NotificationEvent diff --git a/api/uievents/v1/server.pb.gw.go b/api/uievents/v1/server.pb.gw.go index e968c8546df..7a044e6b3ba 100644 --- a/api/uievents/v1/server.pb.gw.go +++ b/api/uievents/v1/server.pb.gw.go @@ -148,10 +148,6 @@ func RegisterUIEventsServiceHandlerClient(ctx context.Context, mux *runtime.Serv return nil } -var ( - pattern_UIEventsService_Store_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ui-events", "Store"}, "")) -) +var pattern_UIEventsService_Store_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ui-events", "Store"}, "")) -var ( - forward_UIEventsService_Store_0 = runtime.ForwardResponseMessage -) +var forward_UIEventsService_Store_0 = runtime.ForwardResponseMessage diff --git a/api/uievents/v1/server.swagger.json b/api/uievents/v1/server.swagger.json deleted file mode 100644 index b77aec150ac..00000000000 --- a/api/uievents/v1/server.swagger.json +++ /dev/null @@ -1,202 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "uievents/v1/server.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "UIEventsService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/ui-events/Store": { - "post": { - "summary": "Persist UI events", - "description": "Persists received UI events for further processing.", - "operationId": "Store", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1StoreResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1StoreRequest" - } - } - ], - "tags": [ - "UIEventsService" - ] - } - } - }, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1DashboardUsageEvent": { - "type": "object", - "properties": { - "uid": { - "type": "string" - }, - "title": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "load_time": { - "type": "integer", - "format": "int32" - }, - "location": { - "type": "string" - }, - "location_params": { - "type": "string" - } - } - }, - "v1FetchingEvent": { - "type": "object", - "properties": { - "component": { - "type": "string" - }, - "load_time": { - "type": "integer", - "format": "int32" - }, - "location": { - "type": "string" - }, - "location_params": { - "type": "string" - } - } - }, - "v1NotificationEvent": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "text": { - "type": "string" - }, - "location": { - "type": "string" - }, - "location_params": { - "type": "string" - } - } - }, - "v1StoreRequest": { - "type": "object", - "properties": { - "notifications": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1NotificationEvent" - } - }, - "fetching": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1FetchingEvent" - } - }, - "dashboard_usage": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1DashboardUsageEvent" - } - }, - "user_flow_events": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1UserFlowEvent" - } - } - } - }, - "v1StoreResponse": { - "type": "object" - }, - "v1UserFlowEvent": { - "type": "object", - "properties": { - "flow_id": { - "type": "string" - }, - "story_id": { - "type": "string" - }, - "event": { - "type": "string" - }, - "params": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - } -} diff --git a/api/uievents/v1/server_grpc.pb.go b/api/uievents/v1/server_grpc.pb.go index 3a3848baa05..f4343f61ac3 100644 --- a/api/uievents/v1/server_grpc.pb.go +++ b/api/uievents/v1/server_grpc.pb.go @@ -8,6 +8,7 @@ package uieventsv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/user/v1/user.pb.go b/api/user/v1/user.pb.go index ea4c06a469e..12a954ca3f4 100644 --- a/api/user/v1/user.pb.go +++ b/api/user/v1/user.pb.go @@ -7,14 +7,15 @@ package userv1 import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" ) const ( @@ -493,17 +494,20 @@ func file_user_v1_user_proto_rawDescGZIP() []byte { return file_user_v1_user_proto_rawDescData } -var file_user_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_user_v1_user_proto_goTypes = []any{ - (*GetUserRequest)(nil), // 0: user.v1.GetUserRequest - (*GetUserResponse)(nil), // 1: user.v1.GetUserResponse - (*UpdateUserRequest)(nil), // 2: user.v1.UpdateUserRequest - (*UpdateUserResponse)(nil), // 3: user.v1.UpdateUserResponse - (*ListUsersRequest)(nil), // 4: user.v1.ListUsersRequest - (*ListUsersResponse)(nil), // 5: user.v1.ListUsersResponse - (*ListUsersResponse_UserDetail)(nil), // 6: user.v1.ListUsersResponse.UserDetail - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp -} +var ( + file_user_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 7) + file_user_v1_user_proto_goTypes = []any{ + (*GetUserRequest)(nil), // 0: user.v1.GetUserRequest + (*GetUserResponse)(nil), // 1: user.v1.GetUserResponse + (*UpdateUserRequest)(nil), // 2: user.v1.UpdateUserRequest + (*UpdateUserResponse)(nil), // 3: user.v1.UpdateUserResponse + (*ListUsersRequest)(nil), // 4: user.v1.ListUsersRequest + (*ListUsersResponse)(nil), // 5: user.v1.ListUsersResponse + (*ListUsersResponse_UserDetail)(nil), // 6: user.v1.ListUsersResponse.UserDetail + (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp + } +) + var file_user_v1_user_proto_depIdxs = []int32{ 7, // 0: user.v1.GetUserResponse.snoozed_at:type_name -> google.protobuf.Timestamp 7, // 1: user.v1.UpdateUserResponse.snoozed_at:type_name -> google.protobuf.Timestamp diff --git a/api/user/v1/user.swagger.json b/api/user/v1/user.swagger.json deleted file mode 100644 index 736cc43bfc0..00000000000 --- a/api/user/v1/user.swagger.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "User API", - "version": "version not set" - }, - "tags": [ - { - "name": "UserService" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/users": { - "get": { - "summary": "List all users", - "description": "Retrieve user details for all users from PMM server", - "operationId": "ListUsers", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ListUsersResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "UserService" - ] - } - }, - "/v1/users/me": { - "get": { - "summary": "Get user details", - "description": "Retrieve user details from PMM server", - "operationId": "GetUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1GetUserResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "UserService" - ] - }, - "put": { - "summary": "Update a user", - "description": "Update user details in PMM server", - "operationId": "UpdateUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UpdateUserResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1UpdateUserRequest" - } - } - ], - "tags": [ - "UserService" - ] - } - } - }, - "definitions": { - "ListUsersResponseUserDetail": { - "type": "object", - "properties": { - "user_id": { - "type": "integer", - "format": "int64" - }, - "role_ids": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "description": "List of role IDs assigned to the user." - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1GetUserResponse": { - "type": "object", - "properties": { - "user_id": { - "type": "integer", - "format": "int64", - "title": "User ID" - }, - "product_tour_completed": { - "type": "boolean", - "title": "Product Tour" - }, - "alerting_tour_completed": { - "type": "boolean", - "title": "Alerting Tour" - }, - "snoozed_pmm_version": { - "type": "string", - "title": "Snoozed PMM version update" - }, - "snoozed_at": { - "type": "string", - "format": "date-time", - "title": "Timestamp of last snooze" - }, - "snooze_count": { - "type": "integer", - "format": "int64", - "title": "Number of times the update was snoozed" - } - } - }, - "v1ListUsersResponse": { - "type": "object", - "properties": { - "users": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/ListUsersResponseUserDetail" - } - } - } - }, - "v1UpdateUserRequest": { - "type": "object", - "properties": { - "product_tour_completed": { - "type": "boolean", - "x-nullable": true, - "title": "Product Tour" - }, - "alerting_tour_completed": { - "type": "boolean", - "x-nullable": true, - "title": "Alerting Tour" - }, - "snoozed_pmm_version": { - "type": "string", - "x-nullable": true, - "title": "Snooze update alert for a PMM version" - } - } - }, - "v1UpdateUserResponse": { - "type": "object", - "properties": { - "user_id": { - "type": "integer", - "format": "int64", - "title": "User ID" - }, - "product_tour_completed": { - "type": "boolean", - "title": "Product Tour" - }, - "alerting_tour_completed": { - "type": "boolean", - "title": "Alerting Tour" - }, - "snoozed_pmm_version": { - "type": "string", - "title": "Snooze update alert for a PMM version" - }, - "snoozed_at": { - "type": "string", - "format": "date-time", - "title": "Timestamp of last snooze" - }, - "snooze_count": { - "type": "integer", - "format": "int64", - "title": "Number of times the update was snoozed" - } - } - } - } -} diff --git a/api/user/v1/user_grpc.pb.go b/api/user/v1/user_grpc.pb.go index 5166f03fc21..4201de2b381 100644 --- a/api/user/v1/user_grpc.pb.go +++ b/api/user/v1/user_grpc.pb.go @@ -8,6 +8,7 @@ package userv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -95,9 +96,11 @@ type UnimplementedUserServiceServer struct{} func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetUser not implemented") } + func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) { return nil, status.Error(codes.Unimplemented, "method UpdateUser not implemented") } + func (UnimplementedUserServiceServer) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListUsers not implemented") } diff --git a/managed/services/grafana/auth_server_test.go b/managed/services/grafana/auth_server_test.go index eb1e4b72910..ca81ee19ae6 100644 --- a/managed/services/grafana/auth_server_test.go +++ b/managed/services/grafana/auth_server_test.go @@ -102,16 +102,16 @@ func TestAuthServerAuthenticate(t *testing.T) { "/agent.Agent/Connect": admin, "/realtimeanalytics.v1.CollectorService/Collect": admin, - "/inventory.v1.Nodes/ListNodes": admin, - "/actions.v1.ActionsService/StartServiceAction": viewer, - "/management.v1.ManagementService/RemoveService": admin, - "/management.v1.ManagementService/ListServices": admin, - "/management.v1.ManagementService/AddAnnotation": admin, + "/inventory.v1.Nodes/ListNodes": admin, + "/actions.v1.ActionsService/StartServiceAction": viewer, + "/management.v1.ManagementService/RemoveService": admin, + "/management.v1.ManagementService/ListServices": admin, + "/management.v1.ManagementService/AddAnnotation": admin, "/management.v1.ManagementService/CreateNodeInstallToken": admin, - "/server.v1.ServerService/CheckUpdates": viewer, - "/server.v1.ServerService/StartUpdate": admin, - "/server.v1.ServerService/UpdateStatus": none, - "/server.v1.ServerService/AWSInstanceCheck": none, + "/server.v1.ServerService/CheckUpdates": viewer, + "/server.v1.ServerService/StartUpdate": admin, + "/server.v1.ServerService/UpdateStatus": none, + "/server.v1.ServerService/AWSInstanceCheck": none, "/v1/inventory/nodes": admin, "/v1/actions:startServiceAction": viewer, diff --git a/managed/services/grafana/client.go b/managed/services/grafana/client.go index 0cfa5aaabc5..5eee9d68932 100644 --- a/managed/services/grafana/client.go +++ b/managed/services/grafana/client.go @@ -28,8 +28,8 @@ import ( "strings" "time" - gapi "github.com/grafana/grafana-api-golang-client" "github.com/google/uuid" + gapi "github.com/grafana/grafana-api-golang-client" "github.com/pkg/errors" prom "github.com/prometheus/client_golang/prometheus" "github.com/sirupsen/logrus" diff --git a/managed/services/management/mock_grafana_client_test.go b/managed/services/management/mock_grafana_client_test.go index 475d9c992cd..14c5abb65f9 100644 --- a/managed/services/management/mock_grafana_client_test.go +++ b/managed/services/management/mock_grafana_client_test.go @@ -42,6 +42,48 @@ func (_m *mockGrafanaClient) CreateAnnotation(ctx context.Context, tags []string return r0, r1 } +// CreateNodeInstallToken provides a mock function with given fields: ctx, technology, ttlSeconds +func (_m *mockGrafanaClient) CreateNodeInstallToken(ctx context.Context, technology string, ttlSeconds int64) (int64, string, time.Time, error) { + ret := _m.Called(ctx, technology, ttlSeconds) + + if len(ret) == 0 { + panic("no return value specified for CreateNodeInstallToken") + } + + var r0 int64 + var r1 string + var r2 time.Time + var r3 error + if rf, ok := ret.Get(0).(func(context.Context, string, int64) (int64, string, time.Time, error)); ok { + return rf(ctx, technology, ttlSeconds) + } + if rf, ok := ret.Get(0).(func(context.Context, string, int64) int64); ok { + r0 = rf(ctx, technology, ttlSeconds) + } else { + r0 = ret.Get(0).(int64) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, int64) string); ok { + r1 = rf(ctx, technology, ttlSeconds) + } else { + r1 = ret.Get(1).(string) + } + + if rf, ok := ret.Get(2).(func(context.Context, string, int64) time.Time); ok { + r2 = rf(ctx, technology, ttlSeconds) + } else { + r2 = ret.Get(2).(time.Time) + } + + if rf, ok := ret.Get(3).(func(context.Context, string, int64) error); ok { + r3 = rf(ctx, technology, ttlSeconds) + } else { + r3 = ret.Error(3) + } + + return r0, r1, r2, r3 +} + // CreateServiceAccount provides a mock function with given fields: ctx, noneName, reregister func (_m *mockGrafanaClient) CreateServiceAccount(ctx context.Context, noneName string, reregister bool) (int, string, error) { ret := _m.Called(ctx, noneName, reregister) @@ -77,31 +119,6 @@ func (_m *mockGrafanaClient) CreateServiceAccount(ctx context.Context, noneName return r0, r1, r2 } -// CreateNodeInstallToken provides a mock function for install-token flow. -func (_m *mockGrafanaClient) CreateNodeInstallToken(ctx context.Context, technology string, ttlSeconds int64) (int64, string, time.Time, error) { - ret := _m.Called(ctx, technology, ttlSeconds) - - var r0 int64 - var r1 string - var r2 time.Time - var r3 error - if rf, ok := ret.Get(0).(func(context.Context, string, int64) (int64, string, time.Time, error)); ok { - return rf(ctx, technology, ttlSeconds) - } - if ret.Get(0) != nil { - r0 = ret.Get(0).(int64) - } - if ret.Get(1) != nil { - r1 = ret.Get(1).(string) - } - if ret.Get(2) != nil { - r2 = ret.Get(2).(time.Time) - } - r3 = ret.Error(3) - - return r0, r1, r2, r3 -} - // DeleteServiceAccount provides a mock function with given fields: ctx, noneName, force func (_m *mockGrafanaClient) DeleteServiceAccount(ctx context.Context, noneName string, force bool) (string, error) { ret := _m.Called(ctx, noneName, force) From 83397cf149f4b1d9d073795e2b23676655443d43 Mon Sep 17 00:00:00 2001 From: theTibi Date: Tue, 12 May 2026 22:03:19 +0200 Subject: [PATCH 16/36] refactor: remove CreateNodeInstallTokenRequest and CreateNodeInstallTokenResponse from API - Deleted the CreateNodeInstallTokenRequest and CreateNodeInstallTokenResponse messages from the proto definition and related validation logic, as they are no longer needed. - Updated the ManagementService interface and its implementation to remove references to the CreateNodeInstallToken method. - Adjusted related JSON and gateway files to reflect the removal of the token creation functionality. These changes streamline the API and improve maintainability by eliminating unused components. Signed-off-by: theTibi --- api-tests/management/nodes_test.go | 61 -- .../create_node_install_token_parameters.go | 147 ----- .../create_node_install_token_responses.go | 522 ------------------ .../management_service_client.go | 46 -- api/management/v1/json/v1.json | 94 ---- api/management/v1/node.pb.go | 248 ++------- api/management/v1/node.pb.validate.go | 243 -------- api/management/v1/node.proto | 18 - api/management/v1/service.pb.go | 168 +++--- api/management/v1/service.pb.gw.go | 118 +--- api/management/v1/service.proto | 11 - api/management/v1/service_grpc.pb.go | 80 +-- api/swagger/swagger-dev.json | 94 ---- api/swagger/swagger.json | 94 ---- managed/services/grafana/auth_server_test.go | 1 - managed/services/grafana/client.go | 107 +--- managed/services/management/deps.go | 1 - managed/services/management/install_token.go | 81 --- .../services/management/install_token_test.go | 122 ---- .../management/mock_grafana_client_test.go | 42 -- ui/apps/pmm/src/api/installToken.ts | 111 +++- ui/apps/pmm/src/api/managementEndpoints.ts | 2 - .../install-client/InstallClientPage.tsx | 5 +- .../install-client/InstallClientPage.utils.ts | 6 +- 24 files changed, 280 insertions(+), 2142 deletions(-) delete mode 100644 api/management/v1/json/client/management_service/create_node_install_token_parameters.go delete mode 100644 api/management/v1/json/client/management_service/create_node_install_token_responses.go delete mode 100644 managed/services/management/install_token.go delete mode 100644 managed/services/management/install_token_test.go delete mode 100644 ui/apps/pmm/src/api/managementEndpoints.ts diff --git a/api-tests/management/nodes_test.go b/api-tests/management/nodes_test.go index 7bc73a3e5ad..403eaeaaf77 100644 --- a/api-tests/management/nodes_test.go +++ b/api-tests/management/nodes_test.go @@ -445,64 +445,3 @@ func TestNodeRegister(t *testing.T) { require.Nil(t, registerOK) }) } - -func TestCreateNodeInstallToken(t *testing.T) { - t.Parallel() - - t.Run("ok mysql with default ttl", func(t *testing.T) { - t.Parallel() - params := mservice.CreateNodeInstallTokenParams{ - Context: pmmapitests.Context, - Body: mservice.CreateNodeInstallTokenBody{ - Technology: "mysql", - }, - } - ok, err := client.Default.ManagementService.CreateNodeInstallToken(¶ms) - require.NoError(t, err) - require.NotNil(t, ok) - require.NotNil(t, ok.Payload) - assert.NotEmpty(t, ok.Payload.Token) - assert.NotZero(t, ok.Payload.ServiceAccountID) - assert.NotNil(t, ok.Payload.ExpiresAt) - }) - - t.Run("invalid technology returns 400", func(t *testing.T) { - t.Parallel() - params := mservice.CreateNodeInstallTokenParams{ - Context: pmmapitests.Context, - Body: mservice.CreateNodeInstallTokenBody{ - Technology: "oracle", - }, - } - ok, err := client.Default.ManagementService.CreateNodeInstallToken(¶ms) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, `unsupported technology "oracle"`) - require.Nil(t, ok) - }) - - t.Run("empty technology returns 400", func(t *testing.T) { - t.Parallel() - params := mservice.CreateNodeInstallTokenParams{ - Context: pmmapitests.Context, - Body: mservice.CreateNodeInstallTokenBody{}, - } - ok, err := client.Default.ManagementService.CreateNodeInstallToken(¶ms) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, `unsupported technology`) - require.Nil(t, ok) - }) - - t.Run("ttl above the cap is silently clamped, request still succeeds", func(t *testing.T) { - t.Parallel() - params := mservice.CreateNodeInstallTokenParams{ - Context: pmmapitests.Context, - Body: mservice.CreateNodeInstallTokenBody{ - Technology: "postgresql", - TTLSeconds: 24 * 60 * 60, // 24h — way above the 15-min hard cap. - }, - } - ok, err := client.Default.ManagementService.CreateNodeInstallToken(¶ms) - require.NoError(t, err) - require.NotNil(t, ok) - require.NotNil(t, ok.Payload) - assert.NotEmpty(t, ok.Payload.Token) - }) -} diff --git a/api/management/v1/json/client/management_service/create_node_install_token_parameters.go b/api/management/v1/json/client/management_service/create_node_install_token_parameters.go deleted file mode 100644 index 6f84f24da00..00000000000 --- a/api/management/v1/json/client/management_service/create_node_install_token_parameters.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package management_service - -// 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" -) - -// NewCreateNodeInstallTokenParams creates a new CreateNodeInstallTokenParams 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 NewCreateNodeInstallTokenParams() *CreateNodeInstallTokenParams { - return &CreateNodeInstallTokenParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateNodeInstallTokenParamsWithTimeout creates a new CreateNodeInstallTokenParams object -// with the ability to set a timeout on a request. -func NewCreateNodeInstallTokenParamsWithTimeout(timeout time.Duration) *CreateNodeInstallTokenParams { - return &CreateNodeInstallTokenParams{ - timeout: timeout, - } -} - -// NewCreateNodeInstallTokenParamsWithContext creates a new CreateNodeInstallTokenParams object -// with the ability to set a context for a request. -func NewCreateNodeInstallTokenParamsWithContext(ctx context.Context) *CreateNodeInstallTokenParams { - return &CreateNodeInstallTokenParams{ - Context: ctx, - } -} - -// NewCreateNodeInstallTokenParamsWithHTTPClient creates a new CreateNodeInstallTokenParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateNodeInstallTokenParamsWithHTTPClient(client *http.Client) *CreateNodeInstallTokenParams { - return &CreateNodeInstallTokenParams{ - HTTPClient: client, - } -} - -/* -CreateNodeInstallTokenParams contains all the parameters to send to the API endpoint - - for the create node install token operation. - - Typically these are written to a http.Request. -*/ -type CreateNodeInstallTokenParams struct { - /* Body. - - CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash). - */ - Body CreateNodeInstallTokenBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create node install token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateNodeInstallTokenParams) WithDefaults() *CreateNodeInstallTokenParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create node install token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateNodeInstallTokenParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create node install token params -func (o *CreateNodeInstallTokenParams) WithTimeout(timeout time.Duration) *CreateNodeInstallTokenParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create node install token params -func (o *CreateNodeInstallTokenParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create node install token params -func (o *CreateNodeInstallTokenParams) WithContext(ctx context.Context) *CreateNodeInstallTokenParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create node install token params -func (o *CreateNodeInstallTokenParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create node install token params -func (o *CreateNodeInstallTokenParams) WithHTTPClient(client *http.Client) *CreateNodeInstallTokenParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create node install token params -func (o *CreateNodeInstallTokenParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create node install token params -func (o *CreateNodeInstallTokenParams) WithBody(body CreateNodeInstallTokenBody) *CreateNodeInstallTokenParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create node install token params -func (o *CreateNodeInstallTokenParams) SetBody(body CreateNodeInstallTokenBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateNodeInstallTokenParams) 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/management/v1/json/client/management_service/create_node_install_token_responses.go b/api/management/v1/json/client/management_service/create_node_install_token_responses.go deleted file mode 100644 index 4693dfb3483..00000000000 --- a/api/management/v1/json/client/management_service/create_node_install_token_responses.go +++ /dev/null @@ -1,522 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package management_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - stderrors "errors" - "fmt" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateNodeInstallTokenReader is a Reader for the CreateNodeInstallToken structure. -type CreateNodeInstallTokenReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateNodeInstallTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewCreateNodeInstallTokenOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewCreateNodeInstallTokenDefault(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 - } -} - -// NewCreateNodeInstallTokenOK creates a CreateNodeInstallTokenOK with default headers values -func NewCreateNodeInstallTokenOK() *CreateNodeInstallTokenOK { - return &CreateNodeInstallTokenOK{} -} - -/* -CreateNodeInstallTokenOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type CreateNodeInstallTokenOK struct { - Payload *CreateNodeInstallTokenOKBody -} - -// IsSuccess returns true when this create node install token Ok response has a 2xx status code -func (o *CreateNodeInstallTokenOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create node install token Ok response has a 3xx status code -func (o *CreateNodeInstallTokenOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create node install token Ok response has a 4xx status code -func (o *CreateNodeInstallTokenOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this create node install token Ok response has a 5xx status code -func (o *CreateNodeInstallTokenOK) IsServerError() bool { - return false -} - -// IsCode returns true when this create node install token Ok response a status code equal to that given -func (o *CreateNodeInstallTokenOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the create node install token Ok response -func (o *CreateNodeInstallTokenOK) Code() int { - return 200 -} - -func (o *CreateNodeInstallTokenOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/nodes:installToken][%d] createNodeInstallTokenOk %s", 200, payload) -} - -func (o *CreateNodeInstallTokenOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/nodes:installToken][%d] createNodeInstallTokenOk %s", 200, payload) -} - -func (o *CreateNodeInstallTokenOK) GetPayload() *CreateNodeInstallTokenOKBody { - return o.Payload -} - -func (o *CreateNodeInstallTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CreateNodeInstallTokenOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewCreateNodeInstallTokenDefault creates a CreateNodeInstallTokenDefault with default headers values -func NewCreateNodeInstallTokenDefault(code int) *CreateNodeInstallTokenDefault { - return &CreateNodeInstallTokenDefault{ - _statusCode: code, - } -} - -/* -CreateNodeInstallTokenDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type CreateNodeInstallTokenDefault struct { - _statusCode int - - Payload *CreateNodeInstallTokenDefaultBody -} - -// IsSuccess returns true when this create node install token default response has a 2xx status code -func (o *CreateNodeInstallTokenDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this create node install token default response has a 3xx status code -func (o *CreateNodeInstallTokenDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this create node install token default response has a 4xx status code -func (o *CreateNodeInstallTokenDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this create node install token default response has a 5xx status code -func (o *CreateNodeInstallTokenDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this create node install token default response a status code equal to that given -func (o *CreateNodeInstallTokenDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the create node install token default response -func (o *CreateNodeInstallTokenDefault) Code() int { - return o._statusCode -} - -func (o *CreateNodeInstallTokenDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/nodes:installToken][%d] CreateNodeInstallToken default %s", o._statusCode, payload) -} - -func (o *CreateNodeInstallTokenDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/nodes:installToken][%d] CreateNodeInstallToken default %s", o._statusCode, payload) -} - -func (o *CreateNodeInstallTokenDefault) GetPayload() *CreateNodeInstallTokenDefaultBody { - return o.Payload -} - -func (o *CreateNodeInstallTokenDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CreateNodeInstallTokenDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -CreateNodeInstallTokenBody CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash). -swagger:model CreateNodeInstallTokenBody -*/ -type CreateNodeInstallTokenBody struct { - // Token TTL in seconds; 0 means use server default. Server clamps to a maximum. - TTLSeconds int64 `json:"ttl_seconds,omitempty"` - - // Technology for install script TECH env (e.g. mysql, postgresql, mongodb). - Technology string `json:"technology,omitempty"` -} - -// Validate validates this create node install token body -func (o *CreateNodeInstallTokenBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create node install token body based on context it is used -func (o *CreateNodeInstallTokenBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateNodeInstallTokenBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateNodeInstallTokenBody) UnmarshalBinary(b []byte) error { - var res CreateNodeInstallTokenBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateNodeInstallTokenDefaultBody create node install token default body -swagger:model CreateNodeInstallTokenDefaultBody -*/ -type CreateNodeInstallTokenDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*CreateNodeInstallTokenDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this create node install token default body -func (o *CreateNodeInstallTokenDefaultBody) 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 *CreateNodeInstallTokenDefaultBody) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("CreateNodeInstallToken default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("CreateNodeInstallToken default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this create node install token default body based on the context it is used -func (o *CreateNodeInstallTokenDefaultBody) 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 *CreateNodeInstallTokenDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - - if swag.IsZero(o.Details[i]) { // not required - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("CreateNodeInstallToken default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("CreateNodeInstallToken default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateNodeInstallTokenDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateNodeInstallTokenDefaultBody) UnmarshalBinary(b []byte) error { - var res CreateNodeInstallTokenDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateNodeInstallTokenDefaultBodyDetailsItems0 create node install token default body details items0 -swagger:model CreateNodeInstallTokenDefaultBodyDetailsItems0 -*/ -type CreateNodeInstallTokenDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // create node install token default body details items0 - CreateNodeInstallTokenDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *CreateNodeInstallTokenDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - // at type - AtType string `json:"@type,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv CreateNodeInstallTokenDefaultBodyDetailsItems0 - - rcv.AtType = stage1.AtType - *o = rcv - - // stage 2, remove properties and add to map - stage2 := make(map[string]json.RawMessage) - if err := json.Unmarshal(data, &stage2); err != nil { - return err - } - - delete(stage2, "@type") - // stage 3, add additional properties values - if len(stage2) > 0 { - result := make(map[string]any) - for k, v := range stage2 { - var toadd any - if err := json.Unmarshal(v, &toadd); err != nil { - return err - } - result[k] = toadd - } - o.CreateNodeInstallTokenDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o CreateNodeInstallTokenDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { - var stage1 struct { - // at type - AtType string `json:"@type,omitempty"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.CreateNodeInstallTokenDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.CreateNodeInstallTokenDefaultBodyDetailsItems0) - if err != nil { - return nil, err - } - - if len(props) < 3 { // "{}": only additional properties - return additional, nil - } - - // concatenate the 2 objects - return swag.ConcatJSON(props, additional), nil -} - -// Validate validates this create node install token default body details items0 -func (o *CreateNodeInstallTokenDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create node install token default body details items0 based on context it is used -func (o *CreateNodeInstallTokenDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateNodeInstallTokenDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateNodeInstallTokenDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res CreateNodeInstallTokenDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateNodeInstallTokenOKBody CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL. -swagger:model CreateNodeInstallTokenOKBody -*/ -type CreateNodeInstallTokenOKBody struct { - // Plaintext token for PMM_SERVER_URL userinfo (service_token:). - Token string `json:"token,omitempty"` - - // Expiration time of the token (derived from TTL). - // Format: date-time - ExpiresAt strfmt.DateTime `json:"expires_at,omitempty"` - - // Grafana service account id created for this install token flow. - ServiceAccountID string `json:"service_account_id,omitempty"` -} - -// Validate validates this create node install token OK body -func (o *CreateNodeInstallTokenOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateExpiresAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateNodeInstallTokenOKBody) validateExpiresAt(formats strfmt.Registry) error { - if swag.IsZero(o.ExpiresAt) { // not required - return nil - } - - if err := validate.FormatOf("createNodeInstallTokenOk"+"."+"expires_at", "body", "date-time", o.ExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this create node install token OK body based on context it is used -func (o *CreateNodeInstallTokenOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateNodeInstallTokenOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateNodeInstallTokenOKBody) UnmarshalBinary(b []byte) error { - var res CreateNodeInstallTokenOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/management/v1/json/client/management_service/management_service_client.go b/api/management/v1/json/client/management_service/management_service_client.go index 1bd281d0e74..febfb2dbe2a 100644 --- a/api/management/v1/json/client/management_service/management_service_client.go +++ b/api/management/v1/json/client/management_service/management_service_client.go @@ -60,8 +60,6 @@ type ClientService interface { AddService(params *AddServiceParams, opts ...ClientOption) (*AddServiceOK, error) - CreateNodeInstallToken(params *CreateNodeInstallTokenParams, opts ...ClientOption) (*CreateNodeInstallTokenOK, error) - DiscoverAzureDatabase(params *DiscoverAzureDatabaseParams, opts ...ClientOption) (*DiscoverAzureDatabaseOK, error) DiscoverRDS(params *DiscoverRDSParams, opts ...ClientOption) (*DiscoverRDSOK, error) @@ -217,50 +215,6 @@ func (a *Client) AddService(params *AddServiceParams, opts ...ClientOption) (*Ad return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } -/* -CreateNodeInstallToken creates node install token - -Creates a short-lived Grafana service account token for PMM Client install. -*/ -func (a *Client) CreateNodeInstallToken(params *CreateNodeInstallTokenParams, opts ...ClientOption) (*CreateNodeInstallTokenOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewCreateNodeInstallTokenParams() - } - op := &runtime.ClientOperation{ - ID: "CreateNodeInstallToken", - Method: "POST", - PathPattern: "/v1/management/nodes:installToken", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &CreateNodeInstallTokenReader{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 - } - - // only one success response has to be checked - success, ok := result.(*CreateNodeInstallTokenOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*CreateNodeInstallTokenDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - /* DiscoverAzureDatabase discovers azure database diff --git a/api/management/v1/json/v1.json b/api/management/v1/json/v1.json index 0ed18ef1ab6..77060c656b4 100644 --- a/api/management/v1/json/v1.json +++ b/api/management/v1/json/v1.json @@ -1460,100 +1460,6 @@ } } }, - "/v1/management/nodes:installToken": { - "post": { - "description": "Creates a short-lived Grafana service account token for PMM Client install.", - "tags": [ - "ManagementService" - ], - "summary": "Create Node Install Token", - "operationId": "CreateNodeInstallToken", - "parameters": [ - { - "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", - "type": "object", - "properties": { - "ttl_seconds": { - "description": "Token TTL in seconds; 0 means use server default. Server clamps to a maximum.", - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "technology": { - "description": "Technology for install script TECH env (e.g. mysql, postgresql, mongodb).", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL.", - "type": "object", - "properties": { - "token": { - "description": "Plaintext token for PMM_SERVER_URL userinfo (service_token:\u003ctoken\u003e).", - "type": "string", - "x-order": 0 - }, - "expires_at": { - "description": "Expiration time of the token (derived from TTL).", - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "service_account_id": { - "description": "Grafana service account id created for this install token flow.", - "type": "string", - "format": "int64", - "x-order": 2 - } - } - } - }, - "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": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, "/v1/management/services": { "get": { "description": "Returns a filtered list of Services.", diff --git a/api/management/v1/node.pb.go b/api/management/v1/node.pb.go index e4d8f1ce979..de24278803f 100644 --- a/api/management/v1/node.pb.go +++ b/api/management/v1/node.pb.go @@ -7,16 +7,14 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/envoyproxy/protoc-gen-validate/validate" + v1 "github.com/percona/pmm/api/inventory/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -963,125 +961,6 @@ func (x *GetNodeResponse) GetNode() *UniversalNode { return nil } -// CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash). -type CreateNodeInstallTokenRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Token TTL in seconds; 0 means use server default. Server clamps to a maximum. - TtlSeconds uint32 `protobuf:"varint,1,opt,name=ttl_seconds,json=ttlSeconds,proto3" json:"ttl_seconds,omitempty"` - // Technology for install script TECH env (e.g. mysql, postgresql, mongodb). - Technology string `protobuf:"bytes,2,opt,name=technology,proto3" json:"technology,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateNodeInstallTokenRequest) Reset() { - *x = CreateNodeInstallTokenRequest{} - mi := &file_management_v1_node_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateNodeInstallTokenRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateNodeInstallTokenRequest) ProtoMessage() {} - -func (x *CreateNodeInstallTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateNodeInstallTokenRequest.ProtoReflect.Descriptor instead. -func (*CreateNodeInstallTokenRequest) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{10} -} - -func (x *CreateNodeInstallTokenRequest) GetTtlSeconds() uint32 { - if x != nil { - return x.TtlSeconds - } - return 0 -} - -func (x *CreateNodeInstallTokenRequest) GetTechnology() string { - if x != nil { - return x.Technology - } - return "" -} - -// CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL. -type CreateNodeInstallTokenResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Plaintext token for PMM_SERVER_URL userinfo (service_token:). - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - // Expiration time of the token (derived from TTL). - ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` - // Grafana service account id created for this install token flow. - ServiceAccountId int64 `protobuf:"varint,3,opt,name=service_account_id,json=serviceAccountId,proto3" json:"service_account_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateNodeInstallTokenResponse) Reset() { - *x = CreateNodeInstallTokenResponse{} - mi := &file_management_v1_node_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateNodeInstallTokenResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateNodeInstallTokenResponse) ProtoMessage() {} - -func (x *CreateNodeInstallTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateNodeInstallTokenResponse.ProtoReflect.Descriptor instead. -func (*CreateNodeInstallTokenResponse) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{11} -} - -func (x *CreateNodeInstallTokenResponse) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -func (x *CreateNodeInstallTokenResponse) GetExpiresAt() *timestamppb.Timestamp { - if x != nil { - return x.ExpiresAt - } - return nil -} - -func (x *CreateNodeInstallTokenResponse) GetServiceAccountId() int64 { - if x != nil { - return x.ServiceAccountId - } - return 0 -} - // Service represents a service running on a node. type UniversalNode_Service struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -1097,7 +976,7 @@ type UniversalNode_Service struct { func (x *UniversalNode_Service) Reset() { *x = UniversalNode_Service{} - mi := &file_management_v1_node_proto_msgTypes[14] + mi := &file_management_v1_node_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1109,7 +988,7 @@ func (x *UniversalNode_Service) String() string { func (*UniversalNode_Service) ProtoMessage() {} func (x *UniversalNode_Service) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[14] + mi := &file_management_v1_node_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1162,7 +1041,7 @@ type UniversalNode_Agent struct { func (x *UniversalNode_Agent) Reset() { *x = UniversalNode_Agent{} - mi := &file_management_v1_node_proto_msgTypes[15] + mi := &file_management_v1_node_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1174,7 +1053,7 @@ func (x *UniversalNode_Agent) String() string { func (*UniversalNode_Agent) ProtoMessage() {} func (x *UniversalNode_Agent) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[15] + mi := &file_management_v1_node_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1330,18 +1209,7 @@ const file_management_v1_node_proto_rawDesc = "" + "\x0eGetNodeRequest\x12 \n" + "\anode_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\"C\n" + "\x0fGetNodeResponse\x120\n" + - "\x04node\x18\x01 \x01(\v2\x1c.management.v1.UniversalNodeR\x04node\"`\n" + - "\x1dCreateNodeInstallTokenRequest\x12\x1f\n" + - "\vttl_seconds\x18\x01 \x01(\rR\n" + - "ttlSeconds\x12\x1e\n" + - "\n" + - "technology\x18\x02 \x01(\tR\n" + - "technology\"\x9f\x01\n" + - "\x1eCreateNodeInstallTokenResponse\x12\x14\n" + - "\x05token\x18\x01 \x01(\tR\x05token\x129\n" + - "\n" + - "expires_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\x12,\n" + - "\x12service_account_id\x18\x03 \x01(\x03R\x10serviceAccountIdB\xaa\x01\n" + + "\x04node\x18\x01 \x01(\v2\x1c.management.v1.UniversalNodeR\x04nodeB\xaa\x01\n" + "\x11com.management.v1B\tNodeProtoP\x01Z5github.com/percona/pmm/api/management/v1;managementv1\xa2\x02\x03MXX\xaa\x02\rManagement.V1\xca\x02\rManagement\\V1\xe2\x02\x19Management\\V1\\GPBMetadata\xea\x02\x0eManagement::V1b\x06proto3" var ( @@ -1356,61 +1224,55 @@ func file_management_v1_node_proto_rawDescGZIP() []byte { return file_management_v1_node_proto_rawDescData } -var ( - file_management_v1_node_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_management_v1_node_proto_msgTypes = make([]protoimpl.MessageInfo, 17) - file_management_v1_node_proto_goTypes = []any{ - (UniversalNode_Status)(0), // 0: management.v1.UniversalNode.Status - (*AddNodeParams)(nil), // 1: management.v1.AddNodeParams - (*RegisterNodeRequest)(nil), // 2: management.v1.RegisterNodeRequest - (*RegisterNodeResponse)(nil), // 3: management.v1.RegisterNodeResponse - (*UnregisterNodeRequest)(nil), // 4: management.v1.UnregisterNodeRequest - (*UnregisterNodeResponse)(nil), // 5: management.v1.UnregisterNodeResponse - (*UniversalNode)(nil), // 6: management.v1.UniversalNode - (*ListNodesRequest)(nil), // 7: management.v1.ListNodesRequest - (*ListNodesResponse)(nil), // 8: management.v1.ListNodesResponse - (*GetNodeRequest)(nil), // 9: management.v1.GetNodeRequest - (*GetNodeResponse)(nil), // 10: management.v1.GetNodeResponse - (*CreateNodeInstallTokenRequest)(nil), // 11: management.v1.CreateNodeInstallTokenRequest - (*CreateNodeInstallTokenResponse)(nil), // 12: management.v1.CreateNodeInstallTokenResponse - nil, // 13: management.v1.AddNodeParams.CustomLabelsEntry - nil, // 14: management.v1.RegisterNodeRequest.CustomLabelsEntry - (*UniversalNode_Service)(nil), // 15: management.v1.UniversalNode.Service - (*UniversalNode_Agent)(nil), // 16: management.v1.UniversalNode.Agent - nil, // 17: management.v1.UniversalNode.CustomLabelsEntry - (v1.NodeType)(0), // 18: inventory.v1.NodeType - (MetricsMode)(0), // 19: management.v1.MetricsMode - (*v1.GenericNode)(nil), // 20: inventory.v1.GenericNode - (*v1.ContainerNode)(nil), // 21: inventory.v1.ContainerNode - (*v1.PMMAgent)(nil), // 22: inventory.v1.PMMAgent - (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp - } -) - +var file_management_v1_node_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_management_v1_node_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_management_v1_node_proto_goTypes = []any{ + (UniversalNode_Status)(0), // 0: management.v1.UniversalNode.Status + (*AddNodeParams)(nil), // 1: management.v1.AddNodeParams + (*RegisterNodeRequest)(nil), // 2: management.v1.RegisterNodeRequest + (*RegisterNodeResponse)(nil), // 3: management.v1.RegisterNodeResponse + (*UnregisterNodeRequest)(nil), // 4: management.v1.UnregisterNodeRequest + (*UnregisterNodeResponse)(nil), // 5: management.v1.UnregisterNodeResponse + (*UniversalNode)(nil), // 6: management.v1.UniversalNode + (*ListNodesRequest)(nil), // 7: management.v1.ListNodesRequest + (*ListNodesResponse)(nil), // 8: management.v1.ListNodesResponse + (*GetNodeRequest)(nil), // 9: management.v1.GetNodeRequest + (*GetNodeResponse)(nil), // 10: management.v1.GetNodeResponse + nil, // 11: management.v1.AddNodeParams.CustomLabelsEntry + nil, // 12: management.v1.RegisterNodeRequest.CustomLabelsEntry + (*UniversalNode_Service)(nil), // 13: management.v1.UniversalNode.Service + (*UniversalNode_Agent)(nil), // 14: management.v1.UniversalNode.Agent + nil, // 15: management.v1.UniversalNode.CustomLabelsEntry + (v1.NodeType)(0), // 16: inventory.v1.NodeType + (MetricsMode)(0), // 17: management.v1.MetricsMode + (*v1.GenericNode)(nil), // 18: inventory.v1.GenericNode + (*v1.ContainerNode)(nil), // 19: inventory.v1.ContainerNode + (*v1.PMMAgent)(nil), // 20: inventory.v1.PMMAgent + (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp +} var file_management_v1_node_proto_depIdxs = []int32{ - 18, // 0: management.v1.AddNodeParams.node_type:type_name -> inventory.v1.NodeType - 13, // 1: management.v1.AddNodeParams.custom_labels:type_name -> management.v1.AddNodeParams.CustomLabelsEntry - 18, // 2: management.v1.RegisterNodeRequest.node_type:type_name -> inventory.v1.NodeType - 14, // 3: management.v1.RegisterNodeRequest.custom_labels:type_name -> management.v1.RegisterNodeRequest.CustomLabelsEntry - 19, // 4: management.v1.RegisterNodeRequest.metrics_mode:type_name -> management.v1.MetricsMode - 20, // 5: management.v1.RegisterNodeResponse.generic_node:type_name -> inventory.v1.GenericNode - 21, // 6: management.v1.RegisterNodeResponse.container_node:type_name -> inventory.v1.ContainerNode - 22, // 7: management.v1.RegisterNodeResponse.pmm_agent:type_name -> inventory.v1.PMMAgent - 17, // 8: management.v1.UniversalNode.custom_labels:type_name -> management.v1.UniversalNode.CustomLabelsEntry - 23, // 9: management.v1.UniversalNode.created_at:type_name -> google.protobuf.Timestamp - 23, // 10: management.v1.UniversalNode.updated_at:type_name -> google.protobuf.Timestamp + 16, // 0: management.v1.AddNodeParams.node_type:type_name -> inventory.v1.NodeType + 11, // 1: management.v1.AddNodeParams.custom_labels:type_name -> management.v1.AddNodeParams.CustomLabelsEntry + 16, // 2: management.v1.RegisterNodeRequest.node_type:type_name -> inventory.v1.NodeType + 12, // 3: management.v1.RegisterNodeRequest.custom_labels:type_name -> management.v1.RegisterNodeRequest.CustomLabelsEntry + 17, // 4: management.v1.RegisterNodeRequest.metrics_mode:type_name -> management.v1.MetricsMode + 18, // 5: management.v1.RegisterNodeResponse.generic_node:type_name -> inventory.v1.GenericNode + 19, // 6: management.v1.RegisterNodeResponse.container_node:type_name -> inventory.v1.ContainerNode + 20, // 7: management.v1.RegisterNodeResponse.pmm_agent:type_name -> inventory.v1.PMMAgent + 15, // 8: management.v1.UniversalNode.custom_labels:type_name -> management.v1.UniversalNode.CustomLabelsEntry + 21, // 9: management.v1.UniversalNode.created_at:type_name -> google.protobuf.Timestamp + 21, // 10: management.v1.UniversalNode.updated_at:type_name -> google.protobuf.Timestamp 0, // 11: management.v1.UniversalNode.status:type_name -> management.v1.UniversalNode.Status - 16, // 12: management.v1.UniversalNode.agents:type_name -> management.v1.UniversalNode.Agent - 15, // 13: management.v1.UniversalNode.services:type_name -> management.v1.UniversalNode.Service - 18, // 14: management.v1.ListNodesRequest.node_type:type_name -> inventory.v1.NodeType + 14, // 12: management.v1.UniversalNode.agents:type_name -> management.v1.UniversalNode.Agent + 13, // 13: management.v1.UniversalNode.services:type_name -> management.v1.UniversalNode.Service + 16, // 14: management.v1.ListNodesRequest.node_type:type_name -> inventory.v1.NodeType 6, // 15: management.v1.ListNodesResponse.nodes:type_name -> management.v1.UniversalNode 6, // 16: management.v1.GetNodeResponse.node:type_name -> management.v1.UniversalNode - 23, // 17: management.v1.CreateNodeInstallTokenResponse.expires_at:type_name -> google.protobuf.Timestamp - 18, // [18:18] is the sub-list for method output_type - 18, // [18:18] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name + 17, // [17:17] is the sub-list for method output_type + 17, // [17:17] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_management_v1_node_proto_init() } @@ -1425,7 +1287,7 @@ func file_management_v1_node_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_node_proto_rawDesc), len(file_management_v1_node_proto_rawDesc)), NumEnums: 1, - NumMessages: 17, + NumMessages: 15, NumExtensions: 0, NumServices: 0, }, diff --git a/api/management/v1/node.pb.validate.go b/api/management/v1/node.pb.validate.go index c87c75bf9c6..62a389ade8a 100644 --- a/api/management/v1/node.pb.validate.go +++ b/api/management/v1/node.pb.validate.go @@ -1457,249 +1457,6 @@ var _ interface { ErrorName() string } = GetNodeResponseValidationError{} -// Validate checks the field values on CreateNodeInstallTokenRequest 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 *CreateNodeInstallTokenRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreateNodeInstallTokenRequest 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 -// CreateNodeInstallTokenRequestMultiError, or nil if none found. -func (m *CreateNodeInstallTokenRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *CreateNodeInstallTokenRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for TtlSeconds - - // no validation rules for Technology - - if len(errors) > 0 { - return CreateNodeInstallTokenRequestMultiError(errors) - } - - return nil -} - -// CreateNodeInstallTokenRequestMultiError is an error wrapping multiple -// validation errors returned by CreateNodeInstallTokenRequest.ValidateAll() -// if the designated constraints aren't met. -type CreateNodeInstallTokenRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreateNodeInstallTokenRequestMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m CreateNodeInstallTokenRequestMultiError) AllErrors() []error { return m } - -// CreateNodeInstallTokenRequestValidationError is the validation error -// returned by CreateNodeInstallTokenRequest.Validate if the designated -// constraints aren't met. -type CreateNodeInstallTokenRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreateNodeInstallTokenRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreateNodeInstallTokenRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreateNodeInstallTokenRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreateNodeInstallTokenRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreateNodeInstallTokenRequestValidationError) ErrorName() string { - return "CreateNodeInstallTokenRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e CreateNodeInstallTokenRequestValidationError) 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 %sCreateNodeInstallTokenRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreateNodeInstallTokenRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreateNodeInstallTokenRequestValidationError{} - -// Validate checks the field values on CreateNodeInstallTokenResponse 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 *CreateNodeInstallTokenResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreateNodeInstallTokenResponse 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 -// CreateNodeInstallTokenResponseMultiError, or nil if none found. -func (m *CreateNodeInstallTokenResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *CreateNodeInstallTokenResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Token - - if all { - switch v := interface{}(m.GetExpiresAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateNodeInstallTokenResponseValidationError{ - field: "ExpiresAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CreateNodeInstallTokenResponseValidationError{ - field: "ExpiresAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExpiresAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreateNodeInstallTokenResponseValidationError{ - field: "ExpiresAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for ServiceAccountId - - if len(errors) > 0 { - return CreateNodeInstallTokenResponseMultiError(errors) - } - - return nil -} - -// CreateNodeInstallTokenResponseMultiError is an error wrapping multiple -// validation errors returned by CreateNodeInstallTokenResponse.ValidateAll() -// if the designated constraints aren't met. -type CreateNodeInstallTokenResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreateNodeInstallTokenResponseMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m CreateNodeInstallTokenResponseMultiError) AllErrors() []error { return m } - -// CreateNodeInstallTokenResponseValidationError is the validation error -// returned by CreateNodeInstallTokenResponse.Validate if the designated -// constraints aren't met. -type CreateNodeInstallTokenResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreateNodeInstallTokenResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreateNodeInstallTokenResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreateNodeInstallTokenResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreateNodeInstallTokenResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreateNodeInstallTokenResponseValidationError) ErrorName() string { - return "CreateNodeInstallTokenResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e CreateNodeInstallTokenResponseValidationError) 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 %sCreateNodeInstallTokenResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreateNodeInstallTokenResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreateNodeInstallTokenResponseValidationError{} - // Validate checks the field values on UniversalNode_Service 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/management/v1/node.proto b/api/management/v1/node.proto index 251ee7b86cd..74b16d47f3a 100644 --- a/api/management/v1/node.proto +++ b/api/management/v1/node.proto @@ -183,21 +183,3 @@ message GetNodeRequest { message GetNodeResponse { UniversalNode node = 1; } - -// CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash). -message CreateNodeInstallTokenRequest { - // Token TTL in seconds; 0 means use server default. Server clamps to a maximum. - uint32 ttl_seconds = 1; - // Technology for install script TECH env (e.g. mysql, postgresql, mongodb). - string technology = 2; -} - -// CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL. -message CreateNodeInstallTokenResponse { - // Plaintext token for PMM_SERVER_URL userinfo (service_token:). - string token = 1; - // Expiration time of the token (derived from TTL). - google.protobuf.Timestamp expires_at = 2; - // Grafana service account id created for this install token flow. - int64 service_account_id = 3; -} diff --git a/api/management/v1/service.pb.go b/api/management/v1/service.pb.go index 15d9fce8fae..20ab0da7230 100644 --- a/api/management/v1/service.pb.go +++ b/api/management/v1/service.pb.go @@ -7,17 +7,15 @@ package managementv1 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + v1 "github.com/percona/pmm/api/inventory/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - v1 "github.com/percona/pmm/api/inventory/v1" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -919,7 +917,7 @@ const file_management_v1_service_proto_rawDesc = "" + "\fservice_type\x18\x02 \x01(\x0e2\x19.inventory.v1.ServiceTypeR\vserviceType\x12%\n" + "\x0eexternal_group\x18\x03 \x01(\tR\rexternalGroup\"S\n" + "\x14ListServicesResponse\x12;\n" + - "\bservices\x18\x01 \x03(\v2\x1f.management.v1.UniversalServiceR\bservices2\xb4\x15\n" + + "\bservices\x18\x01 \x03(\v2\x1f.management.v1.UniversalServiceR\bservices2\xa2\x13\n" + "\x11ManagementService\x12\xac\x01\n" + "\rAddAnnotation\x12#.management.v1.AddAnnotationRequest\x1a$.management.v1.AddAnnotationResponse\"P\x92A(\x12\x11Add an Annotation\x1a\x13Adds an annotation.\x82\xd3\xe4\x93\x02\x1f:\x01*\"\x1a/v1/management/annotations\x12\x9b\x01\n" + "\n" + @@ -929,8 +927,7 @@ const file_management_v1_service_proto_rawDesc = "" + "\x0eUnregisterNode\x12$.management.v1.UnregisterNodeRequest\x1a%.management.v1.UnregisterNodeResponse\"^\x92A5\x12\x11Unregister a Node\x1a Unregisters a Node and pmm-agent\x82\xd3\xe4\x93\x02 *\x1e/v1/management/nodes/{node_id}\x12\x95\x01\n" + "\tListNodes\x12\x1f.management.v1.ListNodesRequest\x1a .management.v1.ListNodesResponse\"E\x92A&\x12\n" + "List Nodes\x1a\x18Lists Nodes with filter.\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/management/nodes\x12\x98\x01\n" + - "\aGetNode\x12\x1d.management.v1.GetNodeRequest\x1a\x1e.management.v1.GetNodeResponse\"N\x92A%\x12\bGet Node\x1a\x19Gets a single Node by ID.\x82\xd3\xe4\x93\x02 \x12\x1e/v1/management/nodes/{node_id}\x12\x8f\x02\n" + - "\x16CreateNodeInstallToken\x12,.management.v1.CreateNodeInstallTokenRequest\x1a-.management.v1.CreateNodeInstallTokenResponse\"\x97\x01\x92Ah\x12\x19Create Node Install Token\x1aKCreates a short-lived Grafana service account token for PMM Client install.\x82\xd3\xe4\x93\x02&:\x01*\"!/v1/management/nodes:installToken\x12\xb2\x01\n" + + "\aGetNode\x12\x1d.management.v1.GetNodeRequest\x1a\x1e.management.v1.GetNodeResponse\"N\x92A%\x12\bGet Node\x1a\x19Gets a single Node by ID.\x82\xd3\xe4\x93\x02 \x12\x1e/v1/management/nodes/{node_id}\x12\xb2\x01\n" + "\n" + "AddService\x12 .management.v1.AddServiceRequest\x1a!.management.v1.AddServiceResponse\"_\x92A:\x12\rAdd a Service\x1a)Adds a service and starts several agents.\x82\xd3\xe4\x93\x02\x1c:\x01*\"\x17/v1/management/services\x12\xb0\x01\n" + "\fListServices\x12\".management.v1.ListServicesRequest\x1a#.management.v1.ListServicesResponse\"W\x92A5\x12\rList Services\x1a$Returns a filtered list of Services.\x82\xd3\xe4\x93\x02\x19\x12\x17/v1/management/services\x12\xaf\x01\n" + @@ -952,63 +949,58 @@ func file_management_v1_service_proto_rawDescGZIP() []byte { return file_management_v1_service_proto_rawDescData } -var ( - file_management_v1_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_management_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) - file_management_v1_service_proto_goTypes = []any{ - (UniversalService_Status)(0), // 0: management.v1.UniversalService.Status - (*AddServiceRequest)(nil), // 1: management.v1.AddServiceRequest - (*AddServiceResponse)(nil), // 2: management.v1.AddServiceResponse - (*RemoveServiceRequest)(nil), // 3: management.v1.RemoveServiceRequest - (*RemoveServiceResponse)(nil), // 4: management.v1.RemoveServiceResponse - (*UniversalService)(nil), // 5: management.v1.UniversalService - (*ListServicesRequest)(nil), // 6: management.v1.ListServicesRequest - (*ListServicesResponse)(nil), // 7: management.v1.ListServicesResponse - nil, // 8: management.v1.UniversalService.CustomLabelsEntry - (*AddMySQLServiceParams)(nil), // 9: management.v1.AddMySQLServiceParams - (*AddMongoDBServiceParams)(nil), // 10: management.v1.AddMongoDBServiceParams - (*AddPostgreSQLServiceParams)(nil), // 11: management.v1.AddPostgreSQLServiceParams - (*AddProxySQLServiceParams)(nil), // 12: management.v1.AddProxySQLServiceParams - (*AddHAProxyServiceParams)(nil), // 13: management.v1.AddHAProxyServiceParams - (*AddExternalServiceParams)(nil), // 14: management.v1.AddExternalServiceParams - (*AddRDSServiceParams)(nil), // 15: management.v1.AddRDSServiceParams - (*AddValkeyServiceParams)(nil), // 16: management.v1.AddValkeyServiceParams - (*MySQLServiceResult)(nil), // 17: management.v1.MySQLServiceResult - (*MongoDBServiceResult)(nil), // 18: management.v1.MongoDBServiceResult - (*PostgreSQLServiceResult)(nil), // 19: management.v1.PostgreSQLServiceResult - (*ProxySQLServiceResult)(nil), // 20: management.v1.ProxySQLServiceResult - (*HAProxyServiceResult)(nil), // 21: management.v1.HAProxyServiceResult - (*ExternalServiceResult)(nil), // 22: management.v1.ExternalServiceResult - (*RDSServiceResult)(nil), // 23: management.v1.RDSServiceResult - (*ValkeyServiceResult)(nil), // 24: management.v1.ValkeyServiceResult - (v1.ServiceType)(0), // 25: inventory.v1.ServiceType - (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp - (*UniversalAgent)(nil), // 27: management.v1.UniversalAgent - (*AddAnnotationRequest)(nil), // 28: management.v1.AddAnnotationRequest - (*ListAgentsRequest)(nil), // 29: management.v1.ListAgentsRequest - (*ListAgentVersionsRequest)(nil), // 30: management.v1.ListAgentVersionsRequest - (*RegisterNodeRequest)(nil), // 31: management.v1.RegisterNodeRequest - (*UnregisterNodeRequest)(nil), // 32: management.v1.UnregisterNodeRequest - (*ListNodesRequest)(nil), // 33: management.v1.ListNodesRequest - (*GetNodeRequest)(nil), // 34: management.v1.GetNodeRequest - (*CreateNodeInstallTokenRequest)(nil), // 35: management.v1.CreateNodeInstallTokenRequest - (*DiscoverRDSRequest)(nil), // 36: management.v1.DiscoverRDSRequest - (*DiscoverAzureDatabaseRequest)(nil), // 37: management.v1.DiscoverAzureDatabaseRequest - (*AddAzureDatabaseRequest)(nil), // 38: management.v1.AddAzureDatabaseRequest - (*AddAnnotationResponse)(nil), // 39: management.v1.AddAnnotationResponse - (*ListAgentsResponse)(nil), // 40: management.v1.ListAgentsResponse - (*ListAgentVersionsResponse)(nil), // 41: management.v1.ListAgentVersionsResponse - (*RegisterNodeResponse)(nil), // 42: management.v1.RegisterNodeResponse - (*UnregisterNodeResponse)(nil), // 43: management.v1.UnregisterNodeResponse - (*ListNodesResponse)(nil), // 44: management.v1.ListNodesResponse - (*GetNodeResponse)(nil), // 45: management.v1.GetNodeResponse - (*CreateNodeInstallTokenResponse)(nil), // 46: management.v1.CreateNodeInstallTokenResponse - (*DiscoverRDSResponse)(nil), // 47: management.v1.DiscoverRDSResponse - (*DiscoverAzureDatabaseResponse)(nil), // 48: management.v1.DiscoverAzureDatabaseResponse - (*AddAzureDatabaseResponse)(nil), // 49: management.v1.AddAzureDatabaseResponse - } -) - +var file_management_v1_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_management_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_management_v1_service_proto_goTypes = []any{ + (UniversalService_Status)(0), // 0: management.v1.UniversalService.Status + (*AddServiceRequest)(nil), // 1: management.v1.AddServiceRequest + (*AddServiceResponse)(nil), // 2: management.v1.AddServiceResponse + (*RemoveServiceRequest)(nil), // 3: management.v1.RemoveServiceRequest + (*RemoveServiceResponse)(nil), // 4: management.v1.RemoveServiceResponse + (*UniversalService)(nil), // 5: management.v1.UniversalService + (*ListServicesRequest)(nil), // 6: management.v1.ListServicesRequest + (*ListServicesResponse)(nil), // 7: management.v1.ListServicesResponse + nil, // 8: management.v1.UniversalService.CustomLabelsEntry + (*AddMySQLServiceParams)(nil), // 9: management.v1.AddMySQLServiceParams + (*AddMongoDBServiceParams)(nil), // 10: management.v1.AddMongoDBServiceParams + (*AddPostgreSQLServiceParams)(nil), // 11: management.v1.AddPostgreSQLServiceParams + (*AddProxySQLServiceParams)(nil), // 12: management.v1.AddProxySQLServiceParams + (*AddHAProxyServiceParams)(nil), // 13: management.v1.AddHAProxyServiceParams + (*AddExternalServiceParams)(nil), // 14: management.v1.AddExternalServiceParams + (*AddRDSServiceParams)(nil), // 15: management.v1.AddRDSServiceParams + (*AddValkeyServiceParams)(nil), // 16: management.v1.AddValkeyServiceParams + (*MySQLServiceResult)(nil), // 17: management.v1.MySQLServiceResult + (*MongoDBServiceResult)(nil), // 18: management.v1.MongoDBServiceResult + (*PostgreSQLServiceResult)(nil), // 19: management.v1.PostgreSQLServiceResult + (*ProxySQLServiceResult)(nil), // 20: management.v1.ProxySQLServiceResult + (*HAProxyServiceResult)(nil), // 21: management.v1.HAProxyServiceResult + (*ExternalServiceResult)(nil), // 22: management.v1.ExternalServiceResult + (*RDSServiceResult)(nil), // 23: management.v1.RDSServiceResult + (*ValkeyServiceResult)(nil), // 24: management.v1.ValkeyServiceResult + (v1.ServiceType)(0), // 25: inventory.v1.ServiceType + (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp + (*UniversalAgent)(nil), // 27: management.v1.UniversalAgent + (*AddAnnotationRequest)(nil), // 28: management.v1.AddAnnotationRequest + (*ListAgentsRequest)(nil), // 29: management.v1.ListAgentsRequest + (*ListAgentVersionsRequest)(nil), // 30: management.v1.ListAgentVersionsRequest + (*RegisterNodeRequest)(nil), // 31: management.v1.RegisterNodeRequest + (*UnregisterNodeRequest)(nil), // 32: management.v1.UnregisterNodeRequest + (*ListNodesRequest)(nil), // 33: management.v1.ListNodesRequest + (*GetNodeRequest)(nil), // 34: management.v1.GetNodeRequest + (*DiscoverRDSRequest)(nil), // 35: management.v1.DiscoverRDSRequest + (*DiscoverAzureDatabaseRequest)(nil), // 36: management.v1.DiscoverAzureDatabaseRequest + (*AddAzureDatabaseRequest)(nil), // 37: management.v1.AddAzureDatabaseRequest + (*AddAnnotationResponse)(nil), // 38: management.v1.AddAnnotationResponse + (*ListAgentsResponse)(nil), // 39: management.v1.ListAgentsResponse + (*ListAgentVersionsResponse)(nil), // 40: management.v1.ListAgentVersionsResponse + (*RegisterNodeResponse)(nil), // 41: management.v1.RegisterNodeResponse + (*UnregisterNodeResponse)(nil), // 42: management.v1.UnregisterNodeResponse + (*ListNodesResponse)(nil), // 43: management.v1.ListNodesResponse + (*GetNodeResponse)(nil), // 44: management.v1.GetNodeResponse + (*DiscoverRDSResponse)(nil), // 45: management.v1.DiscoverRDSResponse + (*DiscoverAzureDatabaseResponse)(nil), // 46: management.v1.DiscoverAzureDatabaseResponse + (*AddAzureDatabaseResponse)(nil), // 47: management.v1.AddAzureDatabaseResponse +} var file_management_v1_service_proto_depIdxs = []int32{ 9, // 0: management.v1.AddServiceRequest.mysql:type_name -> management.v1.AddMySQLServiceParams 10, // 1: management.v1.AddServiceRequest.mongodb:type_name -> management.v1.AddMongoDBServiceParams @@ -1041,29 +1033,27 @@ var file_management_v1_service_proto_depIdxs = []int32{ 32, // 28: management.v1.ManagementService.UnregisterNode:input_type -> management.v1.UnregisterNodeRequest 33, // 29: management.v1.ManagementService.ListNodes:input_type -> management.v1.ListNodesRequest 34, // 30: management.v1.ManagementService.GetNode:input_type -> management.v1.GetNodeRequest - 35, // 31: management.v1.ManagementService.CreateNodeInstallToken:input_type -> management.v1.CreateNodeInstallTokenRequest - 1, // 32: management.v1.ManagementService.AddService:input_type -> management.v1.AddServiceRequest - 6, // 33: management.v1.ManagementService.ListServices:input_type -> management.v1.ListServicesRequest - 36, // 34: management.v1.ManagementService.DiscoverRDS:input_type -> management.v1.DiscoverRDSRequest - 37, // 35: management.v1.ManagementService.DiscoverAzureDatabase:input_type -> management.v1.DiscoverAzureDatabaseRequest - 38, // 36: management.v1.ManagementService.AddAzureDatabase:input_type -> management.v1.AddAzureDatabaseRequest - 3, // 37: management.v1.ManagementService.RemoveService:input_type -> management.v1.RemoveServiceRequest - 39, // 38: management.v1.ManagementService.AddAnnotation:output_type -> management.v1.AddAnnotationResponse - 40, // 39: management.v1.ManagementService.ListAgents:output_type -> management.v1.ListAgentsResponse - 41, // 40: management.v1.ManagementService.ListAgentVersions:output_type -> management.v1.ListAgentVersionsResponse - 42, // 41: management.v1.ManagementService.RegisterNode:output_type -> management.v1.RegisterNodeResponse - 43, // 42: management.v1.ManagementService.UnregisterNode:output_type -> management.v1.UnregisterNodeResponse - 44, // 43: management.v1.ManagementService.ListNodes:output_type -> management.v1.ListNodesResponse - 45, // 44: management.v1.ManagementService.GetNode:output_type -> management.v1.GetNodeResponse - 46, // 45: management.v1.ManagementService.CreateNodeInstallToken:output_type -> management.v1.CreateNodeInstallTokenResponse - 2, // 46: management.v1.ManagementService.AddService:output_type -> management.v1.AddServiceResponse - 7, // 47: management.v1.ManagementService.ListServices:output_type -> management.v1.ListServicesResponse - 47, // 48: management.v1.ManagementService.DiscoverRDS:output_type -> management.v1.DiscoverRDSResponse - 48, // 49: management.v1.ManagementService.DiscoverAzureDatabase:output_type -> management.v1.DiscoverAzureDatabaseResponse - 49, // 50: management.v1.ManagementService.AddAzureDatabase:output_type -> management.v1.AddAzureDatabaseResponse - 4, // 51: management.v1.ManagementService.RemoveService:output_type -> management.v1.RemoveServiceResponse - 38, // [38:52] is the sub-list for method output_type - 24, // [24:38] is the sub-list for method input_type + 1, // 31: management.v1.ManagementService.AddService:input_type -> management.v1.AddServiceRequest + 6, // 32: management.v1.ManagementService.ListServices:input_type -> management.v1.ListServicesRequest + 35, // 33: management.v1.ManagementService.DiscoverRDS:input_type -> management.v1.DiscoverRDSRequest + 36, // 34: management.v1.ManagementService.DiscoverAzureDatabase:input_type -> management.v1.DiscoverAzureDatabaseRequest + 37, // 35: management.v1.ManagementService.AddAzureDatabase:input_type -> management.v1.AddAzureDatabaseRequest + 3, // 36: management.v1.ManagementService.RemoveService:input_type -> management.v1.RemoveServiceRequest + 38, // 37: management.v1.ManagementService.AddAnnotation:output_type -> management.v1.AddAnnotationResponse + 39, // 38: management.v1.ManagementService.ListAgents:output_type -> management.v1.ListAgentsResponse + 40, // 39: management.v1.ManagementService.ListAgentVersions:output_type -> management.v1.ListAgentVersionsResponse + 41, // 40: management.v1.ManagementService.RegisterNode:output_type -> management.v1.RegisterNodeResponse + 42, // 41: management.v1.ManagementService.UnregisterNode:output_type -> management.v1.UnregisterNodeResponse + 43, // 42: management.v1.ManagementService.ListNodes:output_type -> management.v1.ListNodesResponse + 44, // 43: management.v1.ManagementService.GetNode:output_type -> management.v1.GetNodeResponse + 2, // 44: management.v1.ManagementService.AddService:output_type -> management.v1.AddServiceResponse + 7, // 45: management.v1.ManagementService.ListServices:output_type -> management.v1.ListServicesResponse + 45, // 46: management.v1.ManagementService.DiscoverRDS:output_type -> management.v1.DiscoverRDSResponse + 46, // 47: management.v1.ManagementService.DiscoverAzureDatabase:output_type -> management.v1.DiscoverAzureDatabaseResponse + 47, // 48: management.v1.ManagementService.AddAzureDatabase:output_type -> management.v1.AddAzureDatabaseResponse + 4, // 49: management.v1.ManagementService.RemoveService:output_type -> management.v1.RemoveServiceResponse + 37, // [37:50] is the sub-list for method output_type + 24, // [24:37] is the sub-list for method input_type 24, // [24:24] is the sub-list for extension type_name 24, // [24:24] is the sub-list for extension extendee 0, // [0:24] is the sub-list for field type_name diff --git a/api/management/v1/service.pb.gw.go b/api/management/v1/service.pb.gw.go index 44393ff2ca1..18c78ee4db1 100644 --- a/api/management/v1/service.pb.gw.go +++ b/api/management/v1/service.pb.gw.go @@ -272,33 +272,6 @@ func local_request_ManagementService_GetNode_0(ctx context.Context, marshaler ru return msg, metadata, err } -func request_ManagementService_CreateNodeInstallToken_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq CreateNodeInstallTokenRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.CreateNodeInstallToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_CreateNodeInstallToken_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq CreateNodeInstallTokenRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.CreateNodeInstallToken(ctx, &protoReq) - return msg, metadata, err -} - func request_ManagementService_AddService_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var ( protoReq AddServiceRequest @@ -641,26 +614,6 @@ func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.Se } forward_ManagementService_GetNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle(http.MethodPost, pattern_ManagementService_CreateNodeInstallToken_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) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/management.v1.ManagementService/CreateNodeInstallToken", runtime.WithHTTPPathPattern("/v1/management/nodes:installToken")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_CreateNodeInstallToken_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_ManagementService_CreateNodeInstallToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle(http.MethodPost, pattern_ManagementService_AddService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -940,23 +893,6 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se } forward_ManagementService_GetNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle(http.MethodPost, pattern_ManagementService_CreateNodeInstallToken_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) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.v1.ManagementService/CreateNodeInstallToken", runtime.WithHTTPPathPattern("/v1/management/nodes:installToken")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_CreateNodeInstallToken_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ManagementService_CreateNodeInstallToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle(http.MethodPost, pattern_ManagementService_AddService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1063,35 +999,33 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se } var ( - pattern_ManagementService_AddAnnotation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "annotations"}, "")) - pattern_ManagementService_ListAgents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "agents"}, "")) - pattern_ManagementService_ListAgentVersions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "agents", "versions"}, "")) - pattern_ManagementService_RegisterNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "nodes"}, "")) - pattern_ManagementService_UnregisterNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "management", "nodes", "node_id"}, "")) - pattern_ManagementService_ListNodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "nodes"}, "")) - pattern_ManagementService_GetNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "management", "nodes", "node_id"}, "")) - pattern_ManagementService_CreateNodeInstallToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "nodes"}, "installToken")) - pattern_ManagementService_AddService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "")) - pattern_ManagementService_ListServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "")) - pattern_ManagementService_DiscoverRDS_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "discoverRDS")) - pattern_ManagementService_DiscoverAzureDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "discoverAzure")) - pattern_ManagementService_AddAzureDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "services", "azure"}, "")) - pattern_ManagementService_RemoveService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "management", "services", "service_id"}, "")) + pattern_ManagementService_AddAnnotation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "annotations"}, "")) + pattern_ManagementService_ListAgents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "agents"}, "")) + pattern_ManagementService_ListAgentVersions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "agents", "versions"}, "")) + pattern_ManagementService_RegisterNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "nodes"}, "")) + pattern_ManagementService_UnregisterNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "management", "nodes", "node_id"}, "")) + pattern_ManagementService_ListNodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "nodes"}, "")) + pattern_ManagementService_GetNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "management", "nodes", "node_id"}, "")) + pattern_ManagementService_AddService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "")) + pattern_ManagementService_ListServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "")) + pattern_ManagementService_DiscoverRDS_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "discoverRDS")) + pattern_ManagementService_DiscoverAzureDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "management", "services"}, "discoverAzure")) + pattern_ManagementService_AddAzureDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "services", "azure"}, "")) + pattern_ManagementService_RemoveService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "management", "services", "service_id"}, "")) ) var ( - forward_ManagementService_AddAnnotation_0 = runtime.ForwardResponseMessage - forward_ManagementService_ListAgents_0 = runtime.ForwardResponseMessage - forward_ManagementService_ListAgentVersions_0 = runtime.ForwardResponseMessage - forward_ManagementService_RegisterNode_0 = runtime.ForwardResponseMessage - forward_ManagementService_UnregisterNode_0 = runtime.ForwardResponseMessage - forward_ManagementService_ListNodes_0 = runtime.ForwardResponseMessage - forward_ManagementService_GetNode_0 = runtime.ForwardResponseMessage - forward_ManagementService_CreateNodeInstallToken_0 = runtime.ForwardResponseMessage - forward_ManagementService_AddService_0 = runtime.ForwardResponseMessage - forward_ManagementService_ListServices_0 = runtime.ForwardResponseMessage - forward_ManagementService_DiscoverRDS_0 = runtime.ForwardResponseMessage - forward_ManagementService_DiscoverAzureDatabase_0 = runtime.ForwardResponseMessage - forward_ManagementService_AddAzureDatabase_0 = runtime.ForwardResponseMessage - forward_ManagementService_RemoveService_0 = runtime.ForwardResponseMessage + forward_ManagementService_AddAnnotation_0 = runtime.ForwardResponseMessage + forward_ManagementService_ListAgents_0 = runtime.ForwardResponseMessage + forward_ManagementService_ListAgentVersions_0 = runtime.ForwardResponseMessage + forward_ManagementService_RegisterNode_0 = runtime.ForwardResponseMessage + forward_ManagementService_UnregisterNode_0 = runtime.ForwardResponseMessage + forward_ManagementService_ListNodes_0 = runtime.ForwardResponseMessage + forward_ManagementService_GetNode_0 = runtime.ForwardResponseMessage + forward_ManagementService_AddService_0 = runtime.ForwardResponseMessage + forward_ManagementService_ListServices_0 = runtime.ForwardResponseMessage + forward_ManagementService_DiscoverRDS_0 = runtime.ForwardResponseMessage + forward_ManagementService_DiscoverAzureDatabase_0 = runtime.ForwardResponseMessage + forward_ManagementService_AddAzureDatabase_0 = runtime.ForwardResponseMessage + forward_ManagementService_RemoveService_0 = runtime.ForwardResponseMessage ) diff --git a/api/management/v1/service.proto b/api/management/v1/service.proto index f13f1d7e57a..afdcfacd5c2 100644 --- a/api/management/v1/service.proto +++ b/api/management/v1/service.proto @@ -188,17 +188,6 @@ service ManagementService { description: "Gets a single Node by ID." }; } - // CreateNodeInstallToken mints a short-lived Grafana token for PMM Client installation scripts (no inventory rows). - rpc CreateNodeInstallToken(CreateNodeInstallTokenRequest) returns (CreateNodeInstallTokenResponse) { - option (google.api.http) = { - post: "/v1/management/nodes:installToken" - body: "*" - }; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Create Node Install Token" - description: "Creates a short-lived Grafana service account token for PMM Client install." - }; - } // MySQL: adds MySQL Service and starts several Agents. // It automatically adds a service to inventory, which is running on provided "node_id", // then adds "mysqld_exporter", and "qan_mysql_perfschema" agents diff --git a/api/management/v1/service_grpc.pb.go b/api/management/v1/service_grpc.pb.go index 69334177242..7693162cf5a 100644 --- a/api/management/v1/service_grpc.pb.go +++ b/api/management/v1/service_grpc.pb.go @@ -8,7 +8,6 @@ package managementv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -20,20 +19,19 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - ManagementService_AddAnnotation_FullMethodName = "/management.v1.ManagementService/AddAnnotation" - ManagementService_ListAgents_FullMethodName = "/management.v1.ManagementService/ListAgents" - ManagementService_ListAgentVersions_FullMethodName = "/management.v1.ManagementService/ListAgentVersions" - ManagementService_RegisterNode_FullMethodName = "/management.v1.ManagementService/RegisterNode" - ManagementService_UnregisterNode_FullMethodName = "/management.v1.ManagementService/UnregisterNode" - ManagementService_ListNodes_FullMethodName = "/management.v1.ManagementService/ListNodes" - ManagementService_GetNode_FullMethodName = "/management.v1.ManagementService/GetNode" - ManagementService_CreateNodeInstallToken_FullMethodName = "/management.v1.ManagementService/CreateNodeInstallToken" - ManagementService_AddService_FullMethodName = "/management.v1.ManagementService/AddService" - ManagementService_ListServices_FullMethodName = "/management.v1.ManagementService/ListServices" - ManagementService_DiscoverRDS_FullMethodName = "/management.v1.ManagementService/DiscoverRDS" - ManagementService_DiscoverAzureDatabase_FullMethodName = "/management.v1.ManagementService/DiscoverAzureDatabase" - ManagementService_AddAzureDatabase_FullMethodName = "/management.v1.ManagementService/AddAzureDatabase" - ManagementService_RemoveService_FullMethodName = "/management.v1.ManagementService/RemoveService" + ManagementService_AddAnnotation_FullMethodName = "/management.v1.ManagementService/AddAnnotation" + ManagementService_ListAgents_FullMethodName = "/management.v1.ManagementService/ListAgents" + ManagementService_ListAgentVersions_FullMethodName = "/management.v1.ManagementService/ListAgentVersions" + ManagementService_RegisterNode_FullMethodName = "/management.v1.ManagementService/RegisterNode" + ManagementService_UnregisterNode_FullMethodName = "/management.v1.ManagementService/UnregisterNode" + ManagementService_ListNodes_FullMethodName = "/management.v1.ManagementService/ListNodes" + ManagementService_GetNode_FullMethodName = "/management.v1.ManagementService/GetNode" + ManagementService_AddService_FullMethodName = "/management.v1.ManagementService/AddService" + ManagementService_ListServices_FullMethodName = "/management.v1.ManagementService/ListServices" + ManagementService_DiscoverRDS_FullMethodName = "/management.v1.ManagementService/DiscoverRDS" + ManagementService_DiscoverAzureDatabase_FullMethodName = "/management.v1.ManagementService/DiscoverAzureDatabase" + ManagementService_AddAzureDatabase_FullMethodName = "/management.v1.ManagementService/AddAzureDatabase" + ManagementService_RemoveService_FullMethodName = "/management.v1.ManagementService/RemoveService" ) // ManagementServiceClient is the client API for ManagementService service. @@ -56,8 +54,6 @@ type ManagementServiceClient 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) - // CreateNodeInstallToken mints a short-lived Grafana token for PMM Client installation scripts (no inventory rows). - CreateNodeInstallToken(ctx context.Context, in *CreateNodeInstallTokenRequest, opts ...grpc.CallOption) (*CreateNodeInstallTokenResponse, error) // AddService adds a Service and starts several Agents. AddService(ctx context.Context, in *AddServiceRequest, opts ...grpc.CallOption) (*AddServiceResponse, error) // ListServices returns a list of Services with a rich set of properties. @@ -150,16 +146,6 @@ func (c *managementServiceClient) GetNode(ctx context.Context, in *GetNodeReques return out, nil } -func (c *managementServiceClient) CreateNodeInstallToken(ctx context.Context, in *CreateNodeInstallTokenRequest, opts ...grpc.CallOption) (*CreateNodeInstallTokenResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateNodeInstallTokenResponse) - err := c.cc.Invoke(ctx, ManagementService_CreateNodeInstallToken_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *managementServiceClient) AddService(ctx context.Context, in *AddServiceRequest, opts ...grpc.CallOption) (*AddServiceResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AddServiceResponse) @@ -240,8 +226,6 @@ type ManagementServiceServer interface { ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) // GetNode returns a single Node by ID. GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) - // CreateNodeInstallToken mints a short-lived Grafana token for PMM Client installation scripts (no inventory rows). - CreateNodeInstallToken(context.Context, *CreateNodeInstallTokenRequest) (*CreateNodeInstallTokenResponse, error) // AddService adds a Service and starts several Agents. AddService(context.Context, *AddServiceRequest) (*AddServiceResponse, error) // ListServices returns a list of Services with a rich set of properties. @@ -267,55 +251,39 @@ type UnimplementedManagementServiceServer struct{} func (UnimplementedManagementServiceServer) AddAnnotation(context.Context, *AddAnnotationRequest) (*AddAnnotationResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddAnnotation not implemented") } - func (UnimplementedManagementServiceServer) ListAgents(context.Context, *ListAgentsRequest) (*ListAgentsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAgents not implemented") } - func (UnimplementedManagementServiceServer) ListAgentVersions(context.Context, *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAgentVersions not implemented") } - func (UnimplementedManagementServiceServer) RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method RegisterNode not implemented") } - func (UnimplementedManagementServiceServer) UnregisterNode(context.Context, *UnregisterNodeRequest) (*UnregisterNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method UnregisterNode not implemented") } - func (UnimplementedManagementServiceServer) ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListNodes not implemented") } - func (UnimplementedManagementServiceServer) GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetNode not implemented") } - -func (UnimplementedManagementServiceServer) CreateNodeInstallToken(context.Context, *CreateNodeInstallTokenRequest) (*CreateNodeInstallTokenResponse, error) { - return nil, status.Error(codes.Unimplemented, "method CreateNodeInstallToken not implemented") -} - func (UnimplementedManagementServiceServer) AddService(context.Context, *AddServiceRequest) (*AddServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddService not implemented") } - func (UnimplementedManagementServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListServices not implemented") } - func (UnimplementedManagementServiceServer) DiscoverRDS(context.Context, *DiscoverRDSRequest) (*DiscoverRDSResponse, error) { return nil, status.Error(codes.Unimplemented, "method DiscoverRDS not implemented") } - func (UnimplementedManagementServiceServer) DiscoverAzureDatabase(context.Context, *DiscoverAzureDatabaseRequest) (*DiscoverAzureDatabaseResponse, error) { return nil, status.Error(codes.Unimplemented, "method DiscoverAzureDatabase not implemented") } - func (UnimplementedManagementServiceServer) AddAzureDatabase(context.Context, *AddAzureDatabaseRequest) (*AddAzureDatabaseResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddAzureDatabase not implemented") } - func (UnimplementedManagementServiceServer) RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveService not implemented") } @@ -466,24 +434,6 @@ func _ManagementService_GetNode_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } -func _ManagementService_CreateNodeInstallToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateNodeInstallTokenRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).CreateNodeInstallToken(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_CreateNodeInstallToken_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).CreateNodeInstallToken(ctx, req.(*CreateNodeInstallTokenRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _ManagementService_AddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddServiceRequest) if err := dec(in); err != nil { @@ -627,10 +577,6 @@ var ManagementService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetNode", Handler: _ManagementService_GetNode_Handler, }, - { - MethodName: "CreateNodeInstallToken", - Handler: _ManagementService_CreateNodeInstallToken_Handler, - }, { MethodName: "AddService", Handler: _ManagementService_AddService_Handler, diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json index d6503a73cb9..1ca1471e02b 100644 --- a/api/swagger/swagger-dev.json +++ b/api/swagger/swagger-dev.json @@ -22681,100 +22681,6 @@ } } }, - "/v1/management/nodes:installToken": { - "post": { - "description": "Creates a short-lived Grafana service account token for PMM Client install.", - "tags": [ - "ManagementService" - ], - "summary": "Create Node Install Token", - "operationId": "CreateNodeInstallToken", - "parameters": [ - { - "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", - "type": "object", - "properties": { - "ttl_seconds": { - "description": "Token TTL in seconds; 0 means use server default. Server clamps to a maximum.", - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "technology": { - "description": "Technology for install script TECH env (e.g. mysql, postgresql, mongodb).", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL.", - "type": "object", - "properties": { - "token": { - "description": "Plaintext token for PMM_SERVER_URL userinfo (service_token:\u003ctoken\u003e).", - "type": "string", - "x-order": 0 - }, - "expires_at": { - "description": "Expiration time of the token (derived from TTL).", - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "service_account_id": { - "description": "Grafana service account id created for this install token flow.", - "type": "string", - "format": "int64", - "x-order": 2 - } - } - } - }, - "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": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, "/v1/management/services": { "get": { "description": "Returns a filtered list of Services.", diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json index 578b3b0af13..6650f3b8266 100644 --- a/api/swagger/swagger.json +++ b/api/swagger/swagger.json @@ -21723,100 +21723,6 @@ } } }, - "/v1/management/nodes:installToken": { - "post": { - "description": "Creates a short-lived Grafana service account token for PMM Client install.", - "tags": [ - "ManagementService" - ], - "summary": "Create Node Install Token", - "operationId": "CreateNodeInstallToken", - "parameters": [ - { - "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "CreateNodeInstallTokenRequest requests a short-lived Grafana service account token for PMM Client install (curl | bash).", - "type": "object", - "properties": { - "ttl_seconds": { - "description": "Token TTL in seconds; 0 means use server default. Server clamps to a maximum.", - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "technology": { - "description": "Technology for install script TECH env (e.g. mysql, postgresql, mongodb).", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "CreateNodeInstallTokenResponse returns a one-time token and expiry for PMM_SERVER_URL.", - "type": "object", - "properties": { - "token": { - "description": "Plaintext token for PMM_SERVER_URL userinfo (service_token:\u003ctoken\u003e).", - "type": "string", - "x-order": 0 - }, - "expires_at": { - "description": "Expiration time of the token (derived from TTL).", - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "service_account_id": { - "description": "Grafana service account id created for this install token flow.", - "type": "string", - "format": "int64", - "x-order": 2 - } - } - } - }, - "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": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, "/v1/management/services": { "get": { "description": "Returns a filtered list of Services.", diff --git a/managed/services/grafana/auth_server_test.go b/managed/services/grafana/auth_server_test.go index ca81ee19ae6..d22c2101b76 100644 --- a/managed/services/grafana/auth_server_test.go +++ b/managed/services/grafana/auth_server_test.go @@ -107,7 +107,6 @@ func TestAuthServerAuthenticate(t *testing.T) { "/management.v1.ManagementService/RemoveService": admin, "/management.v1.ManagementService/ListServices": admin, "/management.v1.ManagementService/AddAnnotation": admin, - "/management.v1.ManagementService/CreateNodeInstallToken": admin, "/server.v1.ServerService/CheckUpdates": viewer, "/server.v1.ServerService/StartUpdate": admin, "/server.v1.ServerService/UpdateStatus": none, diff --git a/managed/services/grafana/client.go b/managed/services/grafana/client.go index 5eee9d68932..efec66adbf2 100644 --- a/managed/services/grafana/client.go +++ b/managed/services/grafana/client.go @@ -28,7 +28,6 @@ import ( "strings" "time" - "github.com/google/uuid" gapi "github.com/grafana/grafana-api-golang-client" "github.com/pkg/errors" prom "github.com/prometheus/client_golang/prometheus" @@ -47,14 +46,8 @@ import ( var ErrFailedToGetToken = errors.New("failed to get the user token") const ( - pmmServiceTokenName = "pmm-agent-st" //nolint:gosec - pmmServiceAccountName = "pmm-agent-sa" //nolint:gosec - pmmInstallServiceTokenPrefix = "pmm-install-st" //nolint:gosec - // pmmInstallServiceAccountName is the *prefix* for shared install SAs. - // One SA per technology is created lazily on first use ("-mysql", "-postgresql", ...); - // every CreateNodeInstallToken call mints a new short-lived token on the existing SA - // instead of creating a fresh SA each time (which would leak Grafana rows over time). - pmmInstallServiceAccountName = "pmm-install-sa" //nolint:gosec + pmmServiceTokenName = "pmm-agent-st" //nolint:gosec + pmmServiceAccountName = "pmm-agent-sa" //nolint:gosec defaultDialTimeout = 3 * time.Second defaultKeepAliveTimeout = 30 * time.Second defaultIdleConnTimeout = 90 * time.Second @@ -434,102 +427,6 @@ func (c *Client) CreateServiceAccount(ctx context.Context, nodeName string, rere return serviceAccountID, serviceToken, nil } -// CreateNodeInstallToken mints a short-lived Grafana token for a PMM Client install script. -// -// Lifecycle: -// - Service accounts are shared per technology ("pmm-install-sa-mysql" etc.) and created -// lazily on first use. This avoids the unbounded growth of one-SA-per-token. -// - Each call mints a brand new token on the per-tech SA with a UUID-suffixed name so -// concurrent or repeated calls cannot collide on Grafana's unique-name constraint. -// - Service accounts use Grafana org role **Admin** (required for `pmm-admin config` / -// inventory APIs in real PMM setups). -// - Token creation uses only `name` + `secondsToLive` in the JSON body. Tokens inherit the -// service account permissions. (Sending extra fields such as `role` has been observed to -// make Grafana ignore `secondsToLive`, falling back to a long default expiry in the UI.) -// - The returned expiry is computed locally from `ttlSeconds`; aligned with Grafana's stored -// expiry when `secondsToLive` is honored. -func (c *Client) CreateNodeInstallToken(ctx context.Context, technology string, ttlSeconds int64) (int64, string, time.Time, error) { - authHeaders, err := auth.GetHeadersFromContext(ctx) - if err != nil { - return 0, "", time.Time{}, err - } - if ttlSeconds <= 0 { - return 0, "", time.Time{}, errors.New("ttlSeconds must be positive") - } - if technology == "" { - return 0, "", time.Time{}, errors.New("technology must not be empty") - } - - saName := fmt.Sprintf("%s-%s", pmmInstallServiceAccountName, technology) - - saID, err := c.findServiceAccountIDByExactName(ctx, saName, authHeaders) - if err != nil { - // Not present yet — create it. We pass force=false on purpose: if a SA - // with the same name somehow already exists (e.g. a racing concurrent call - // that beat the search→miss above), we want the create to fail loudly so - // the next call's search hits it, rather than silently nuking existing tokens. - saID, err = c.createServiceAccountNamed(ctx, saName, admin, false, authHeaders) - if err != nil { - return 0, "", time.Time{}, err - } - } - - tokenName := fmt.Sprintf("%s-%s-%s", pmmInstallServiceTokenPrefix, technology, uuid.NewString()) - key, err := c.createInstallServiceToken(ctx, saID, tokenName, ttlSeconds, authHeaders) - if err != nil { - return 0, "", time.Time{}, err - } - - return int64(saID), key, time.Now().Add(time.Duration(ttlSeconds) * time.Second), nil -} - -// findServiceAccountIDByExactName looks up a Grafana service account by exact name. -// Returns an error wrapping "not found" so callers can branch on errors.Is or just retry-create. -func (c *Client) findServiceAccountIDByExactName(ctx context.Context, name string, authHeaders http.Header) (int, error) { - var res serviceAccountSearch - if err := c.do(ctx, http.MethodGet, "/api/serviceaccounts/search", fmt.Sprintf("query=%s", name), authHeaders, nil, &res); err != nil { - return 0, err - } - for _, sa := range res.ServiceAccounts { - if sa.Name == name { - return sa.ID, nil - } - } - return 0, errors.Errorf("service account %q not found", name) -} - -// createInstallServiceToken POSTs a Grafana service-account token with the given name and TTL, -// and returns the freshly minted secret. The secret cannot be re-fetched from Grafana later, -// so the caller must persist it from the response. -// -// See https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#create-a-token -// — the supported body is `name` and `secondsToLive`. Token permissions follow the service -// account role (we create the install SAs as Admin). Do not add `role` here: some Grafana -// versions ignore `secondsToLive` when extra fields are present, and the UI may show a ~24h -// default expiry even though the server still applies a different TTL. -func (c *Client) createInstallServiceToken(ctx context.Context, serviceAccountID int, tokenName string, ttlSeconds int64, authHeaders http.Header) (string, error) { - b, err := json.Marshal(struct { - Name string `json:"name"` - SecondsToLive int64 `json:"secondsToLive"` - }{ - Name: tokenName, - SecondsToLive: ttlSeconds, - }) - if err != nil { - return "", errors.WithStack(err) - } - - var m map[string]interface{} - if err = c.do(ctx, "POST", fmt.Sprintf("/api/serviceaccounts/%d/tokens", serviceAccountID), "", authHeaders, b, &m); err != nil { - return "", err - } - key, ok := m["key"].(string) - if !ok { - return "", errors.Errorf("grafana token response missing key: %#v", m) - } - return key, nil -} - // DeleteServiceAccount deletes service account by current service token. func (c *Client) DeleteServiceAccount(ctx context.Context, nodeName string, force bool) (string, error) { authHeaders, err := auth.GetHeadersFromContext(ctx) diff --git a/managed/services/management/deps.go b/managed/services/management/deps.go index d416e9a5d27..aa94b71a44a 100644 --- a/managed/services/management/deps.go +++ b/managed/services/management/deps.go @@ -70,7 +70,6 @@ type checksService interface { type grafanaClient interface { CreateAnnotation(ctx context.Context, tags []string, time time.Time, text string, user string) (string, error) CreateServiceAccount(ctx context.Context, noneName string, reregister bool) (int, string, error) - CreateNodeInstallToken(ctx context.Context, technology string, ttlSeconds int64) (int64, string, time.Time, error) DeleteServiceAccount(ctx context.Context, noneName string, force bool) (string, error) } diff --git a/managed/services/management/install_token.go b/managed/services/management/install_token.go deleted file mode 100644 index 55d3ff14d7f..00000000000 --- a/managed/services/management/install_token.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package management - -import ( - "context" - "strings" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/types/known/timestamppb" - - managementv1 "github.com/percona/pmm/api/management/v1" -) - -// Install-token lifetime is intentionally short: the token is only used for the -// initial pmm-admin config handshake, after which pmm-agent stores its own -// per-agent identity and no longer needs it. A 15-minute window covers normal -// install runs while limiting damage if the URL leaks. The Grafana install service -// account uses org Admin; the token TTL is capped at 15 minutes — treat it like a password. -const ( - defaultInstallTokenTTLSeconds = int64(15 * 60) // 15 minutes - maxInstallTokenTTLSeconds = int64(15 * 60) // 15 minutes; hard cap, no caller can exceed - minInstallTokenTTLSeconds = int64(60) // 1 minute floor to leave room for slow installs -) - -// IMPORTANT: keep this list in sync with the `Technology` union in -// ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts — adding a tech -// to one without the other yields either a UI-unreachable code path (server-only) -// or an InvalidArgument at runtime (UI-only). -var installTokenTechnologies = map[string]struct{}{ - "mysql": {}, - "postgresql": {}, - "mongodb": {}, - "valkey": {}, -} - -// CreateNodeInstallToken mints a short-lived Grafana token for PMM Client install; it does not create inventory rows. -func (s *ManagementService) CreateNodeInstallToken( - ctx context.Context, - req *managementv1.CreateNodeInstallTokenRequest, -) (*managementv1.CreateNodeInstallTokenResponse, error) { - tech := strings.ToLower(strings.TrimSpace(req.GetTechnology())) - if _, ok := installTokenTechnologies[tech]; !ok { - return nil, status.Errorf(codes.InvalidArgument, "unsupported technology %q (expected mysql, postgresql, mongodb, or valkey)", req.GetTechnology()) - } - - ttl := int64(req.GetTtlSeconds()) - switch { - case ttl == 0: - ttl = defaultInstallTokenTTLSeconds - case ttl < minInstallTokenTTLSeconds: - ttl = minInstallTokenTTLSeconds - case ttl > maxInstallTokenTTLSeconds: - ttl = maxInstallTokenTTLSeconds - } - - saID, tok, exp, err := s.grafanaClient.CreateNodeInstallToken(ctx, tech, ttl) - if err != nil { - return nil, err - } - - return &managementv1.CreateNodeInstallTokenResponse{ - Token: tok, - ExpiresAt: timestamppb.New(exp), - ServiceAccountId: saID, - }, nil -} diff --git a/managed/services/management/install_token_test.go b/managed/services/management/install_token_test.go deleted file mode 100644 index 320a7af3ebc..00000000000 --- a/managed/services/management/install_token_test.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package management - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - managementv1 "github.com/percona/pmm/api/management/v1" -) - -func TestManagementService_CreateNodeInstallToken(t *testing.T) { - t.Parallel() - - ctx := context.Background() - exp := time.Now().Add(24 * time.Hour) - - t.Run("ok", func(t *testing.T) { - t.Parallel() - gc := &mockGrafanaClient{} - // Asserts the grafana client receives the lowercased, trimmed technology — not a - // computed unique suffix — so the shared-SA-per-tech contract stays intact. - gc.On("CreateNodeInstallToken", mock.Anything, "mysql", defaultInstallTokenTTLSeconds). - Return(int64(42), "tok", exp, nil).Once() - - s := &ManagementService{grafanaClient: gc} - res, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{ - TtlSeconds: 0, - Technology: "mysql", - }) - require.NoError(t, err) - require.Equal(t, "tok", res.Token) - require.Equal(t, int64(42), res.ServiceAccountId) - require.NotNil(t, res.ExpiresAt) - }) - - t.Run("normalises technology casing and whitespace", func(t *testing.T) { - t.Parallel() - gc := &mockGrafanaClient{} - gc.On("CreateNodeInstallToken", mock.Anything, "mongodb", defaultInstallTokenTTLSeconds). - Return(int64(7), "k", exp, nil).Once() - s := &ManagementService{grafanaClient: gc} - _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{ - Technology: " MongoDB ", - }) - require.NoError(t, err) - }) - - t.Run("invalid technology", func(t *testing.T) { - t.Parallel() - s := &ManagementService{grafanaClient: &mockGrafanaClient{}} - _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{Technology: "oracle"}) - require.Error(t, err) - assert.Equal(t, codes.InvalidArgument, status.Code(err)) - }) - - t.Run("empty technology", func(t *testing.T) { - t.Parallel() - s := &ManagementService{grafanaClient: &mockGrafanaClient{}} - _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{}) - require.Error(t, err) - assert.Equal(t, codes.InvalidArgument, status.Code(err)) - }) - - t.Run("ttl clamp max", func(t *testing.T) { - t.Parallel() - gc := &mockGrafanaClient{} - gc.On("CreateNodeInstallToken", mock.Anything, "postgresql", maxInstallTokenTTLSeconds). - Return(int64(1), "t", exp, nil).Once() - s := &ManagementService{grafanaClient: gc} - _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{ - TtlSeconds: 999999999, - Technology: "postgresql", - }) - require.NoError(t, err) - }) - - t.Run("ttl clamp min", func(t *testing.T) { - t.Parallel() - gc := &mockGrafanaClient{} - gc.On("CreateNodeInstallToken", mock.Anything, "mongodb", minInstallTokenTTLSeconds). - Return(int64(1), "t", exp, nil).Once() - s := &ManagementService{grafanaClient: gc} - _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{ - TtlSeconds: 30, - Technology: "mongodb", - }) - require.NoError(t, err) - }) - - t.Run("propagates grafana client error", func(t *testing.T) { - t.Parallel() - gc := &mockGrafanaClient{} - grafanaErr := status.Error(codes.Unavailable, "grafana down") - gc.On("CreateNodeInstallToken", mock.Anything, "valkey", defaultInstallTokenTTLSeconds). - Return(int64(0), "", time.Time{}, grafanaErr).Once() - s := &ManagementService{grafanaClient: gc} - _, err := s.CreateNodeInstallToken(ctx, &managementv1.CreateNodeInstallTokenRequest{Technology: "valkey"}) - require.Error(t, err) - assert.Equal(t, codes.Unavailable, status.Code(err)) - }) -} diff --git a/managed/services/management/mock_grafana_client_test.go b/managed/services/management/mock_grafana_client_test.go index 14c5abb65f9..eeb8dc89818 100644 --- a/managed/services/management/mock_grafana_client_test.go +++ b/managed/services/management/mock_grafana_client_test.go @@ -42,48 +42,6 @@ func (_m *mockGrafanaClient) CreateAnnotation(ctx context.Context, tags []string return r0, r1 } -// CreateNodeInstallToken provides a mock function with given fields: ctx, technology, ttlSeconds -func (_m *mockGrafanaClient) CreateNodeInstallToken(ctx context.Context, technology string, ttlSeconds int64) (int64, string, time.Time, error) { - ret := _m.Called(ctx, technology, ttlSeconds) - - if len(ret) == 0 { - panic("no return value specified for CreateNodeInstallToken") - } - - var r0 int64 - var r1 string - var r2 time.Time - var r3 error - if rf, ok := ret.Get(0).(func(context.Context, string, int64) (int64, string, time.Time, error)); ok { - return rf(ctx, technology, ttlSeconds) - } - if rf, ok := ret.Get(0).(func(context.Context, string, int64) int64); ok { - r0 = rf(ctx, technology, ttlSeconds) - } else { - r0 = ret.Get(0).(int64) - } - - if rf, ok := ret.Get(1).(func(context.Context, string, int64) string); ok { - r1 = rf(ctx, technology, ttlSeconds) - } else { - r1 = ret.Get(1).(string) - } - - if rf, ok := ret.Get(2).(func(context.Context, string, int64) time.Time); ok { - r2 = rf(ctx, technology, ttlSeconds) - } else { - r2 = ret.Get(2).(time.Time) - } - - if rf, ok := ret.Get(3).(func(context.Context, string, int64) error); ok { - r3 = rf(ctx, technology, ttlSeconds) - } else { - r3 = ret.Error(3) - } - - return r0, r1, r2, r3 -} - // CreateServiceAccount provides a mock function with given fields: ctx, noneName, reregister func (_m *mockGrafanaClient) CreateServiceAccount(ctx context.Context, noneName string, reregister bool) (int, string, error) { ret := _m.Called(ctx, noneName, reregister) diff --git a/ui/apps/pmm/src/api/installToken.ts b/ui/apps/pmm/src/api/installToken.ts index 2b64915acd0..f55fa5ad1fa 100644 --- a/ui/apps/pmm/src/api/installToken.ts +++ b/ui/apps/pmm/src/api/installToken.ts @@ -1,22 +1,111 @@ -import { api } from './api'; -import { MANAGEMENT_CREATE_NODE_INSTALL_TOKEN } from './managementEndpoints'; +import { grafanaApi } from './api'; export interface CreateNodeInstallTokenResponse { token: string; - expiresAt?: string; - // The server also returns serviceAccountId (int64-as-string in JSON), but the - // UI does not consume it today. Re-add the field if/when we expose a revoke - // action — see managed/services/grafana/client.go::CreateNodeInstallToken. + expiresAt: string; } -/** Mints a short-lived Grafana token for PMM Client install (authenticated admin session). */ +// Hard cap mirrors the previous server-side cap (15 min). Tokens longer than this +// shouldn't be in someone's terminal scrollback — re-run "Generate token" instead. +const MAX_TTL_SECONDS = 15 * 60; +const DEFAULT_TTL_SECONDS = 15 * 60; + +const SUPPORTED_TECHNOLOGIES = new Set([ + 'mysql', + 'postgresql', + 'mongodb', + 'valkey', +]); + +// Shared SA per technology, created lazily on first use. Same naming scheme the +// removed backend endpoint used so previously-minted SAs are still reusable. +const SA_NAME_PREFIX = 'pmm-install-sa'; +const TOKEN_NAME_PREFIX = 'pmm-install-st'; + +interface GrafanaServiceAccount { + id: number; + name: string; +} + +interface GrafanaServiceAccountSearch { + totalCount: number; + serviceAccounts: GrafanaServiceAccount[]; +} + +interface GrafanaTokenResponse { + id: number; + name: string; + key: string; +} + +/** + * Mints a short-lived Grafana service-account token for a PMM Client install command. + * + * Implementation note: this calls Grafana's serviceaccounts API directly through the + * `/graph/api/` reverse proxy. The user must already be authenticated as a Grafana + * Admin (Grafana rejects the create/mint requests with 403 otherwise) — that's the + * same trust boundary the old backend endpoint had, just one hop shorter. + */ export async function createNodeInstallToken( technology: string, ttlSeconds = 0 ): Promise { - const res = await api.post(MANAGEMENT_CREATE_NODE_INSTALL_TOKEN, { - ttlSeconds, - technology, + if (!SUPPORTED_TECHNOLOGIES.has(technology)) { + throw new Error(`unsupported technology "${technology}"`); + } + + let ttl = ttlSeconds > 0 ? ttlSeconds : DEFAULT_TTL_SECONDS; + if (ttl > MAX_TTL_SECONDS) { + ttl = MAX_TTL_SECONDS; + } + + const saName = `${SA_NAME_PREFIX}-${technology}`; + + let saId = await findServiceAccountIdByName(saName); + if (saId === null) { + saId = await createServiceAccount(saName); + } + + // UUID-suffixed token name keeps concurrent calls from colliding on Grafana's + // per-SA unique-name constraint (Grafana returns 409 otherwise). + const tokenName = `${TOKEN_NAME_PREFIX}-${technology}-${crypto.randomUUID()}`; + const key = await mintToken(saId, tokenName, ttl); + + return { + token: key, + expiresAt: new Date(Date.now() + ttl * 1000).toISOString(), + }; +} + +async function findServiceAccountIdByName(name: string): Promise { + const res = await grafanaApi.get( + '/serviceaccounts/search', + { params: { query: name } } + ); + const match = res.data.serviceAccounts?.find((sa) => sa.name === name); + return match ? match.id : null; +} + +async function createServiceAccount(name: string): Promise { + // Admin role is required for `pmm-admin config`/inventory writes in real PMM setups. + const res = await grafanaApi.post('/serviceaccounts', { + name, + role: 'Admin', + isDisabled: false, }); - return res.data; + return res.data.id; +} + +async function mintToken( + serviceAccountId: number, + tokenName: string, + ttlSeconds: number +): Promise { + // Only `name` + `secondsToLive` — extra fields (`role`) have been observed to + // make some Grafana versions ignore `secondsToLive` and fall back to a long default. + const res = await grafanaApi.post( + `/serviceaccounts/${serviceAccountId}/tokens`, + { name: tokenName, secondsToLive: ttlSeconds } + ); + return res.data.key; } diff --git a/ui/apps/pmm/src/api/managementEndpoints.ts b/ui/apps/pmm/src/api/managementEndpoints.ts deleted file mode 100644 index 90ced557e3b..00000000000 --- a/ui/apps/pmm/src/api/managementEndpoints.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** Path segment relative to axios `baseURL` `/v1/` (see api.ts). */ -export const MANAGEMENT_CREATE_NODE_INSTALL_TOKEN = 'management/nodes:installToken'; diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index ed54ddab915..c81d9b78ca6 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -130,9 +130,8 @@ export const InstallClientPage = () => { try { const res = await createNodeInstallToken(technology, 0); setToken(res.token); - // Server enforces a 15-minute hard cap (see install_token.go). If the - // response unexpectedly omits expiresAt, fall back to "now + 15 min" so - // the countdown still works and we don't silently lose the safety net. + // installToken.ts always returns expiresAt; the fallback is just defensive + // belt-and-braces in case of a future refactor. const expires = res.expiresAt ? new Date(res.expiresAt) : new Date(Date.now() + 15 * 60 * 1000); diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts index d40bfb8bc2c..a9ecb6189f7 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts @@ -1,6 +1,6 @@ -// IMPORTANT: keep this list in sync with `installTokenTechnologies` in -// managed/services/management/install_token.go — adding a tech here without -// adding it there gets you a runtime InvalidArgument from the server. +// IMPORTANT: keep this list in sync with `SUPPORTED_TECHNOLOGIES` in +// api/installToken.ts — adding a tech here without adding it there gets you +// a client-side "unsupported technology" error when generating a token. export type Technology = 'mysql' | 'postgresql' | 'mongodb' | 'valkey'; export type CredentialsMode = 'prompt' | 'env' | 'flags'; From 2d5a83b5328154c577621a78a49c63c9c2e8a802 Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Thu, 14 May 2026 22:03:05 +0300 Subject: [PATCH 17/36] PMM-14993 Optimize post-build.yml --- build/ansible/pmm-docker/post-build.yml | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/build/ansible/pmm-docker/post-build.yml b/build/ansible/pmm-docker/post-build.yml index 0712573ac2b..35416f22d0e 100644 --- a/build/ansible/pmm-docker/post-build.yml +++ b/build/ansible/pmm-docker/post-build.yml @@ -81,29 +81,7 @@ shell: find /srv/clickhouse -mindepth 1 -maxdepth 1 -print0 | xargs -0 rm -rf -- - name: Clean pmm-server dir - shell: find /usr/share/pmm-server -mindepth 1 -maxdepth 1 -print0 | xargs -0 rm -rf -- - - # The cleanup above removes nginx static assets (e.g. local-rss.xml, install-pmm-client.sh) - # that were copied earlier by roles/nginx. Restore them from the ansible tree still present - # in the image at /opt/ansible (see build/docker/server/Dockerfile.el9). - - name: Recreate pmm-static directory for nginx - file: - path: /usr/share/pmm-server/static - state: directory - owner: pmm - group: root - mode: "0775" - - - name: Restore nginx /pmm-static files after pmm-server cleanup - copy: - src: "/opt/ansible/roles/nginx/files/{{ item.name }}" - dest: "/usr/share/pmm-server/static/{{ item.name }}" - owner: pmm - group: root - mode: "{{ item.mode }}" - loop: - - { name: local-rss.xml, mode: "0644" } - - { name: install-pmm-client.sh, mode: "0755" } + shell: find /usr/share/pmm-server -mindepth 1 -maxdepth 1 -not -name static -print0 | xargs -0 rm -rf -- # This step is required because of a change between VictoriaMetrics 1.77.1 and 1.82.1. # VictoriaMetrics tries to atomically rename directories in this folder on startup. From b86602543d78884b376e52ec6b4ae33e16beeca8 Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Thu, 14 May 2026 22:12:53 +0300 Subject: [PATCH 18/36] PMM-14993 Restore a generated file --- api/management/v1/service_grpc.pb.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/api/management/v1/service_grpc.pb.go b/api/management/v1/service_grpc.pb.go index 7693162cf5a..b50380dc4b5 100644 --- a/api/management/v1/service_grpc.pb.go +++ b/api/management/v1/service_grpc.pb.go @@ -8,6 +8,7 @@ package managementv1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -251,39 +252,51 @@ type UnimplementedManagementServiceServer struct{} func (UnimplementedManagementServiceServer) AddAnnotation(context.Context, *AddAnnotationRequest) (*AddAnnotationResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddAnnotation not implemented") } + func (UnimplementedManagementServiceServer) ListAgents(context.Context, *ListAgentsRequest) (*ListAgentsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAgents not implemented") } + func (UnimplementedManagementServiceServer) ListAgentVersions(context.Context, *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListAgentVersions not implemented") } + func (UnimplementedManagementServiceServer) RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method RegisterNode not implemented") } + func (UnimplementedManagementServiceServer) UnregisterNode(context.Context, *UnregisterNodeRequest) (*UnregisterNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method UnregisterNode not implemented") } + func (UnimplementedManagementServiceServer) ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListNodes not implemented") } + func (UnimplementedManagementServiceServer) GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetNode not implemented") } + func (UnimplementedManagementServiceServer) AddService(context.Context, *AddServiceRequest) (*AddServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddService not implemented") } + func (UnimplementedManagementServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) { return nil, status.Error(codes.Unimplemented, "method ListServices not implemented") } + func (UnimplementedManagementServiceServer) DiscoverRDS(context.Context, *DiscoverRDSRequest) (*DiscoverRDSResponse, error) { return nil, status.Error(codes.Unimplemented, "method DiscoverRDS not implemented") } + func (UnimplementedManagementServiceServer) DiscoverAzureDatabase(context.Context, *DiscoverAzureDatabaseRequest) (*DiscoverAzureDatabaseResponse, error) { return nil, status.Error(codes.Unimplemented, "method DiscoverAzureDatabase not implemented") } + func (UnimplementedManagementServiceServer) AddAzureDatabase(context.Context, *AddAzureDatabaseRequest) (*AddAzureDatabaseResponse, error) { return nil, status.Error(codes.Unimplemented, "method AddAzureDatabase not implemented") } + func (UnimplementedManagementServiceServer) RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error) { return nil, status.Error(codes.Unimplemented, "method RemoveService not implemented") } From 4408ba372386afc2d35b9b3371f386fbfe0f00b7 Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Thu, 14 May 2026 23:28:53 +0300 Subject: [PATCH 19/36] PMM-14993 Restore client.go --- managed/services/grafana/client.go | 242 ++++++++++++++++++++++++++++- 1 file changed, 236 insertions(+), 6 deletions(-) diff --git a/managed/services/grafana/client.go b/managed/services/grafana/client.go index 8031933ba1b..3d5a5be2af5 100644 --- a/managed/services/grafana/client.go +++ b/managed/services/grafana/client.go @@ -19,6 +19,7 @@ import ( "bytes" "context" "encoding/json" + stderrors "errors" "fmt" "io" "net" @@ -112,6 +113,36 @@ func (e *clientError) Error() string { return fmt.Sprintf("clientError: %s %s -> %d %s", e.Method, e.URL, e.Code, e.Body) } +// CurrentUserHTTPResponse maps errors returned by Client calls used from current-user HTTP handlers +// to an HTTP status and a small JSON body. Non-Grafana errors (e.g. dial failures) map to 502. +func CurrentUserHTTPResponse(err error) (int, map[string]string) { + var cErr *clientError + if !stderrors.As(err, &cErr) { + return http.StatusBadGateway, map[string]string{"message": "Bad Gateway"} + } + + switch cErr.Code { + case http.StatusUnauthorized: + msg := cErr.ErrorMessage + if msg == "" { + msg = "Unauthorized" + } + return http.StatusUnauthorized, map[string]string{"message": msg} + case http.StatusForbidden: + msg := cErr.ErrorMessage + if msg == "" { + msg = "Forbidden" + } + return http.StatusForbidden, map[string]string{"message": msg} + default: + if cErr.Code >= 500 { + return http.StatusBadGateway, map[string]string{"message": "Bad Gateway"} + } + // Other Grafana 4xx responses are treated as upstream errors for this proxy endpoint. + return http.StatusBadGateway, map[string]string{"message": "Bad Gateway"} + } +} + // do makes HTTP request with given parameters, and decodes JSON response with 200 OK status // to respBody. It returns wrapped clientError on any other status, or other fatal errors. // Ctx is used only for cancelation. @@ -168,6 +199,30 @@ type authUser struct { userID int } +// CurrentUser represents Grafana user payload. +type CurrentUser struct { + ID int `json:"id"` + Email string `json:"email"` + Name string `json:"name"` + Login string `json:"login"` + CreatedAt string `json:"createdAt"` + OrgID int `json:"orgId"` + IsAnonymous bool `json:"isAnonymous"` + IsDisabled bool `json:"isDisabled"` + IsExternal bool `json:"isExternal"` + IsExtarnallySynced bool `json:"isExtarnallySynced"` + IsGrafanaAdmin bool `json:"isGrafanaAdmin"` + IsGrafanaAdminExternallySynced bool `json:"isGrafanaAdminExternallySynced"` + Theme string `json:"theme"` +} + +// CurrentUserOrg represents Grafana org payload. +type CurrentUserOrg struct { + OrgID int `json:"orgId"` + Name string `json:"name"` + Role string `json:"role"` +} + // role defines Grafana user role within the organization // (except grafanaAdmin that is a global flag that is more important than any other role). // Role with more permissions has larger numerical value: viewer < editor, admin < grafanaAdmin, etc. @@ -246,6 +301,24 @@ func (c *Client) getAuthUser(ctx context.Context, authHeaders http.Header, l *lo var m map[string]interface{} err := c.do(ctx, http.MethodGet, "/api/user", "", authHeaders, nil, &m) if err != nil { + if hasAuthorizationHeader(authHeaders) { + return emptyUser, err + } + var cErr *clientError + if !errors.As(err, &cErr) { + return emptyUser, err + } + if cErr.Code != http.StatusUnauthorized { + return emptyUser, err + } + anonymousEnabled, anonymousRole := c.getAnonymousRoleFromSettings(ctx, l) + if anonymousEnabled { + l.Debugf("Grafana returned 401 for /api/user with no credentials; using anonymous role %q.", anonymousRole.String()) + return authUser{ + role: anonymousRole, + userID: 0, + }, nil + } return emptyUser, err } @@ -302,6 +375,168 @@ func (c *Client) convertRole(role string) role { } } +// Grafana /api/frontend/settings may include user org id/name; org role for anonymous comes from anonymousOrgRole. +type frontendUserSettingsFull struct { + OrgID int `json:"orgId"` + OrgName string `json:"orgName"` +} + +type frontendSettingsFull struct { + AnonymousEnabled bool `json:"anonymousEnabled"` + AnonymousOrgRole string `json:"anonymousOrgRole"` + User frontendUserSettingsFull `json:"user"` +} + +func (c *Client) getAnonymousRoleFromSettings(ctx context.Context, l *logrus.Entry) (bool, role) { + settings, err := c.getFrontendSettings(ctx) + if err != nil { + return false, none + } + + if !settings.AnonymousEnabled { + return false, none + } + + parsedRole := c.convertRole(resolveAnonymousOrgRole(settings.AnonymousOrgRole)) + if parsedRole == none { + return false, none + } + l.Debugf("Grafana anonymous mode is enabled with role %q.", parsedRole.String()) + return true, parsedRole +} + +func (c *Client) getFrontendSettings(ctx context.Context) (frontendSettingsFull, error) { + var settings frontendSettingsFull + if err := c.do(ctx, http.MethodGet, "/api/frontend/settings", "", nil, nil, &settings); err != nil { + return frontendSettingsFull{}, err + } + + return settings, nil +} + +func hasAuthorizationHeader(authHeaders http.Header) bool { + return authHeaders.Get("Authorization") != "" +} + +// Grafana organization role strings as returned by /api/frontend/settings (camelCase JSON keys). +const ( + grafanaOrgRoleViewer = "Viewer" + grafanaOrgRoleEditor = "Editor" + grafanaOrgRoleAdmin = "Admin" + grafanaOrgRoleGrafanaAdmin = "GrafanaAdmin" + grafanaOrgRoleNone = "None" +) + +// resolveAnonymousOrgRole maps anonymousOrgRole from /api/frontend/settings ([auth.anonymous] org_role) +// to the org role string PMM uses for anonymous Grafana auth. Grafana does not populate user.orgRole +// in this payload; only anonymousOrgRole is authoritative. Deprecated elevated roles are clamped to Viewer. +func resolveAnonymousOrgRole(anonymousOrgRole string) string { + anonymousOrgRole = strings.TrimSpace(anonymousOrgRole) + + switch anonymousOrgRole { + case grafanaOrgRoleViewer: + return grafanaOrgRoleViewer + case grafanaOrgRoleEditor, grafanaOrgRoleAdmin, grafanaOrgRoleGrafanaAdmin: + return grafanaOrgRoleViewer + default: + return grafanaOrgRoleNone + } +} + +// GetCurrentUser returns current Grafana user. +// If anonymous mode is enabled and no auth headers are present, it returns +// a synthetic anonymous user when /api/user responds with 401. +func (c *Client) GetCurrentUser(ctx context.Context, authHeaders http.Header) (CurrentUser, error) { + var user CurrentUser + err := c.do(ctx, http.MethodGet, "/api/user", "", authHeaders, nil, &user) + if err == nil { + return user, nil + } + + if hasAuthorizationHeader(authHeaders) { + return CurrentUser{}, err + } + var cErr *clientError + if !errors.As(err, &cErr) { + return CurrentUser{}, err + } + if cErr.Code != http.StatusUnauthorized { + return CurrentUser{}, err + } + + settings, settingsErr := c.getFrontendSettings(ctx) + if settingsErr != nil || !settings.AnonymousEnabled { + return CurrentUser{}, err + } + role := resolveAnonymousOrgRole(settings.AnonymousOrgRole) + if role == grafanaOrgRoleNone { + return CurrentUser{}, err + } + + orgID := settings.User.OrgID + if orgID == 0 { + orgID = 1 + } + + return CurrentUser{ + ID: 0, + Email: "", + Name: "Anonymous", + Login: "anonymous", + OrgID: orgID, + IsAnonymous: true, + IsGrafanaAdmin: false, + }, nil +} + +// GetCurrentUserOrgs returns current Grafana user organizations. +// If anonymous mode is enabled and no auth headers are present, it returns +// a synthetic org list when /api/user/orgs responds with 401. +func (c *Client) GetCurrentUserOrgs(ctx context.Context, authHeaders http.Header) ([]CurrentUserOrg, error) { + var orgs []CurrentUserOrg + err := c.do(ctx, http.MethodGet, "/api/user/orgs", "", authHeaders, nil, &orgs) + if err == nil { + return orgs, nil + } + + if hasAuthorizationHeader(authHeaders) { + return nil, err + } + var cErr *clientError + if !errors.As(err, &cErr) { + return nil, err + } + if cErr.Code != http.StatusUnauthorized { + return nil, err + } + + settings, settingsErr := c.getFrontendSettings(ctx) + if settingsErr != nil || !settings.AnonymousEnabled { + return nil, err + } + role := resolveAnonymousOrgRole(settings.AnonymousOrgRole) + if role == grafanaOrgRoleNone { + return nil, err + } + + orgID := settings.User.OrgID + if orgID == 0 { + orgID = 1 + } + orgName := settings.User.OrgName + if orgName == "" { + orgName = "Main Org." + } + + return []CurrentUserOrg{ + { + OrgID: orgID, + Name: orgName, + Role: role, + }, + }, nil +} + func (c *Client) getRoleForServiceToken(ctx context.Context, token string) (role, error) { header := http.Header{} header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) @@ -633,12 +868,7 @@ func (c *Client) createServiceAccount(ctx context.Context, role role, nodeName s } serviceAccountName := fmt.Sprintf("%s-%s", pmmServiceAccountName, nodeName) - return c.createServiceAccountNamed(ctx, serviceAccountName, role, reregister, authHeaders) -} - -// createServiceAccountNamed POSTs a service account and PATCHes orgId to 1. -func (c *Client) createServiceAccountNamed(ctx context.Context, serviceAccountName string, role role, force bool, authHeaders http.Header) (int, error) { - b, err := json.Marshal(serviceAccount{Name: serviceAccountName, Role: role.String(), Force: force}) + b, err := json.Marshal(serviceAccount{Name: serviceAccountName, Role: role.String(), Force: reregister}) if err != nil { return 0, errors.WithStack(err) } From ace5dffdec8856f7969eaf702cfa3dc27b686e3e Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Thu, 14 May 2026 23:44:39 +0300 Subject: [PATCH 20/36] PMM-14993 Leave a comment for the static folder --- build/ansible/pmm-docker/post-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/ansible/pmm-docker/post-build.yml b/build/ansible/pmm-docker/post-build.yml index 35416f22d0e..e53e8ec1ea6 100644 --- a/build/ansible/pmm-docker/post-build.yml +++ b/build/ansible/pmm-docker/post-build.yml @@ -80,6 +80,8 @@ - name: Clean Clickhouse dir shell: find /srv/clickhouse -mindepth 1 -maxdepth 1 -print0 | xargs -0 rm -rf -- + # This step is required removes the static files except for the "static" directory, + # which contains files that are not generated on startup. - name: Clean pmm-server dir shell: find /usr/share/pmm-server -mindepth 1 -maxdepth 1 -not -name static -print0 | xargs -0 rm -rf -- From 5ee0ae6db52e1295d08ca8ed6aeccfc2c9a715f0 Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Fri, 15 May 2026 00:07:11 +0300 Subject: [PATCH 21/36] PMM-14993 Consistent use of single square brackets --- .../roles/nginx/files/install-pmm-client.sh | 75 ++++++++++--------- ui/apps/pmm/src/router.tsx | 2 +- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh index d31b5183b7b..b47ab1fb1a3 100644 --- a/build/ansible/roles/nginx/files/install-pmm-client.sh +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -110,7 +110,7 @@ PMM_AGENT_LISTEN_PORT="${PMM_AGENT_LISTEN_PORT:-7777}" PMM_AGENT_LOG_FILE="${PMM_AGENT_LOG_FILE:-/var/log/pmm-agent.log}" PMM_AGENT_START_TIMEOUT_SECS="${PMM_AGENT_START_TIMEOUT_SECS:-30}" -while [[ $# -gt 0 ]]; do +while [ $# -gt 0 ]; do case "$1" in --help|-h) usage @@ -183,7 +183,7 @@ while [[ $# -gt 0 ]]; do done require_root() { - if [[ "${EUID}" -ne 0 ]]; then + if [ "${EUID}" -ne 0 ]; then error "Run this script as root (for package installation). Example: curl -fsSLk ... | sudo -E env ... bash -s --" fi } @@ -195,19 +195,19 @@ prompt_if_empty() { local hint="${4:-}" local value="${!var_name:-}" - if [[ -n "${value}" ]]; then + if [ -n "${value}" ]; then return fi - if [[ "${secret}" == "1" ]]; then + if [ "${secret}" = "1" ]; then read -r -s -p "${prompt_label}: " value echo else read -r -p "${prompt_label}: " value fi - if [[ -z "${value}" ]]; then - if [[ -n "${hint}" ]]; then + if [ -z "${value}" ]; then + if [ -n "${hint}" ]; then error "${prompt_label} is required. ${hint}" else error "${prompt_label} is required." @@ -218,7 +218,7 @@ prompt_if_empty() { } detect_os_family() { - if [[ -f /etc/os-release ]]; then + if [ -f /etc/os-release ]; then # shellcheck source=/dev/null . /etc/os-release case "${ID:-}" in @@ -232,11 +232,11 @@ detect_os_family() { ;; esac fi - if [[ -f /etc/redhat-release ]] || [[ -f /etc/oracle-release ]]; then + if [ -f /etc/redhat-release ] || [ -f /etc/oracle-release ]; then echo "el" return fi - if [[ -f /etc/debian_version ]]; then + if [ -f /etc/debian_version ]; then echo "debian" return fi @@ -278,7 +278,7 @@ install_pmm_client() { os_family="$(detect_os_family)" log "Detected OS family: ${os_family}" - if [[ "${os_family}" == "el" ]]; then + if [ "${os_family}" = "el" ]; then install_percona_repo_el percona-release enable pmm3-client release || true if command -v dnf >/dev/null 2>&1; then @@ -299,7 +299,7 @@ install_pmm_client() { # Mere presence of systemctl is not enough — Docker images often ship the binary # without PID 1 being systemd, and `systemctl start` then no-ops or fails. systemd_is_running() { - [[ -d /run/systemd/system ]] && command -v systemctl >/dev/null 2>&1 + [ -d /run/systemd/system ] && command -v systemctl >/dev/null 2>&1 } # Cheap TCP probe via bash builtins; no curl/nc dependency. We only need to know @@ -311,12 +311,13 @@ pmm_agent_listening() { } wait_for_pmm_agent() { - local i - for ((i = 0; i < PMM_AGENT_START_TIMEOUT_SECS; i++)); do + local i=0 + while [ "$i" -lt "$PMM_AGENT_START_TIMEOUT_SECS" ]; do if pmm_agent_listening; then return 0 fi sleep 1 + i=$((i + 1)) done return 1 } @@ -330,7 +331,7 @@ wait_for_pmm_agent() { # `set -euo pipefail` aborts the whole script. Order: bash's $HOSTNAME (set # automatically via gethostname() syscall) → uname -n → /etc/hostname → "node". detect_node_hostname() { - if [[ -n "${HOSTNAME:-}" ]]; then + if [ -n "${HOSTNAME:-}" ]; then printf '%s' "${HOSTNAME}" return fi @@ -342,7 +343,7 @@ detect_node_hostname() { uname -n return fi - if [[ -r /etc/hostname ]]; then + if [ -r /etc/hostname ]; then head -n 1 /etc/hostname return fi @@ -352,10 +353,10 @@ detect_node_hostname() { ensure_pmm_agent_config_file() { local dir dir="$(dirname "${PMM_AGENT_CONFIG_FILE}")" - if [[ ! -d "${dir}" ]]; then + if [ ! -d "${dir}" ]; then mkdir -p "${dir}" fi - if [[ ! -e "${PMM_AGENT_CONFIG_FILE}" ]]; then + if [ ! -e "${PMM_AGENT_CONFIG_FILE}" ]; then : > "${PMM_AGENT_CONFIG_FILE}" chmod 0660 "${PMM_AGENT_CONFIG_FILE}" || true log "Created empty pmm-agent config: ${PMM_AGENT_CONFIG_FILE}" @@ -417,13 +418,13 @@ ensure_pmm_agent_running() { fi fi - if [[ "${started}" -eq 0 ]]; then + if [ "${started}" -eq 0 ]; then start_pmm_agent_nohup fi if ! wait_for_pmm_agent; then log "pmm-agent did not bind ${PMM_AGENT_LISTEN_HOST}:${PMM_AGENT_LISTEN_PORT} within ${PMM_AGENT_START_TIMEOUT_SECS}s." - if [[ -f "${PMM_AGENT_LOG_FILE}" ]]; then + if [ -f "${PMM_AGENT_LOG_FILE}" ]; then log "Last 20 lines of ${PMM_AGENT_LOG_FILE}:" tail -n 20 "${PMM_AGENT_LOG_FILE}" >&2 || true elif systemd_is_running; then @@ -444,7 +445,7 @@ ensure_pmm_agent_running() { # 1) curl -fsSL[k] -o /tmp/install-pmm-client.sh '' # 2) sudo -E bash /tmp/install-pmm-client.sh --pmm-server-url ... --tech ... [...] # Step 2 reads the script from disk (not from a pipe), so stdin stays attached -# to the user's TTY through sudo, [[ -t 0 ]] is true, and prompt_if_empty / +# to the user's TTY through sudo, [ -t 0 ] is true, and prompt_if_empty / # read -r -s in add_mysql / add_postgresql / add_mongodb / add_valkey can ask # for DB user and password interactively — unless DB_USER / DB_PASSWORD (or # per-tech MYSQL_* / …) are already set; sudo -E preserves those exports. @@ -452,7 +453,7 @@ ensure_pmm_agent_running() { # when the user followed the UI's prompt-mode command — it only protects the # curl | bash pipeline from registering a half-configured node. require_db_creds_before_config_if_noninteractive() { - if [[ -t 0 ]]; then + if [ -t 0 ]; then return 0 fi @@ -460,22 +461,22 @@ require_db_creds_before_config_if_noninteractive() { case "${TECH}" in mysql) - if [[ -z "${MYSQL_USERNAME}" || -z "${MYSQL_PASSWORD}" ]]; then + if [ -z "${MYSQL_USERNAME}" ] || [ -z "${MYSQL_PASSWORD}" ]; then error "MySQL username and password are required for non-interactive runs. ${hint}" fi ;; postgresql) - if [[ -z "${POSTGRESQL_USERNAME}" || -z "${POSTGRESQL_PASSWORD}" ]]; then + if [ -z "${POSTGRESQL_USERNAME}" ] || [ -z "${POSTGRESQL_PASSWORD}" ]; then error "PostgreSQL username and password are required for non-interactive runs. ${hint}" fi ;; mongodb) - if [[ -z "${MONGODB_USERNAME}" || -z "${MONGODB_PASSWORD}" ]]; then + if [ -z "${MONGODB_USERNAME}" ] || [ -z "${MONGODB_PASSWORD}" ]; then error "MongoDB username and password are required for non-interactive runs. ${hint}" fi ;; valkey) - if [[ -z "${VALKEY_PASSWORD}" ]]; then + if [ -z "${VALKEY_PASSWORD}" ]; then error "Valkey password is required for non-interactive runs (use --db-password or DB_PASSWORD / VALKEY_PASSWORD). ${hint}" fi ;; @@ -489,16 +490,16 @@ configure_pmm_agent() { require_db_creds_before_config_if_noninteractive local config_cmd=(pmm-admin config "--server-url=${PMM_SERVER_URL}") - if [[ "${PMM_SERVER_INSECURE_TLS}" == "1" || "${PMM_SERVER_INSECURE_TLS}" == "true" ]]; then + if [ "${PMM_SERVER_INSECURE_TLS}" = "1" ] || [ "${PMM_SERVER_INSECURE_TLS}" = "true" ]; then config_cmd+=(--server-insecure-tls) fi - if [[ -n "${NODE_ADDRESS}" ]]; then + if [ -n "${NODE_ADDRESS}" ]; then config_cmd+=("${NODE_ADDRESS}") fi - if [[ -n "${NODE_NAME}" ]]; then + if [ -n "${NODE_NAME}" ]; then config_cmd+=("generic" "${NODE_NAME}") fi - if [[ "${PMM_CONFIG_FORCE}" == "1" || "${PMM_CONFIG_FORCE}" == "true" ]]; then + if [ "${PMM_CONFIG_FORCE}" = "1" ] || [ "${PMM_CONFIG_FORCE}" = "true" ]; then config_cmd+=(--force) fi @@ -558,7 +559,7 @@ add_mysql() { MYSQL_ADDRESS="${MYSQL_ADDRESS:-${MYSQL_HOST:-127.0.0.1}:${MYSQL_PORT:-3306}}" MYSQL_SERVICE_NAME="${MYSQL_SERVICE_NAME:-$(detect_node_hostname)-mysql}" local cmd=(pmm-admin add mysql "${MYSQL_SERVICE_NAME}" "${MYSQL_ADDRESS}" "--username=${MYSQL_USERNAME}" "--password=${MYSQL_PASSWORD}") - if [[ -n "${MYSQL_SOCKET}" ]]; then + if [ -n "${MYSQL_SOCKET}" ]; then cmd+=("--socket=${MYSQL_SOCKET}") fi log "Running pmm-admin add mysql..." @@ -572,10 +573,10 @@ add_postgresql() { POSTGRESQL_ADDRESS="${POSTGRESQL_ADDRESS:-${POSTGRESQL_HOST:-127.0.0.1}:${POSTGRESQL_PORT:-5432}}" POSTGRESQL_SERVICE_NAME="${POSTGRESQL_SERVICE_NAME:-$(detect_node_hostname)-postgresql}" local cmd=(pmm-admin add postgresql "${POSTGRESQL_SERVICE_NAME}" "${POSTGRESQL_ADDRESS}" "--username=${POSTGRESQL_USERNAME}" "--password=${POSTGRESQL_PASSWORD}") - if [[ -n "${POSTGRESQL_DATABASE}" ]]; then + if [ -n "${POSTGRESQL_DATABASE}" ]; then cmd+=("--database=${POSTGRESQL_DATABASE}") fi - if [[ -n "${POSTGRESQL_SOCKET}" ]]; then + if [ -n "${POSTGRESQL_SOCKET}" ]; then cmd+=("--socket=${POSTGRESQL_SOCKET}") fi log "Running pmm-admin add postgresql..." @@ -589,10 +590,10 @@ add_mongodb() { MONGODB_ADDRESS="${MONGODB_ADDRESS:-${MONGODB_HOST:-127.0.0.1}:${MONGODB_PORT:-27017}}" MONGODB_SERVICE_NAME="${MONGODB_SERVICE_NAME:-$(detect_node_hostname)-mongodb}" local cmd=(pmm-admin add mongodb "${MONGODB_SERVICE_NAME}" "${MONGODB_ADDRESS}" "--username=${MONGODB_USERNAME}" "--password=${MONGODB_PASSWORD}") - if [[ -n "${MONGODB_AUTH_DB}" ]]; then + if [ -n "${MONGODB_AUTH_DB}" ]; then cmd+=("--authentication-database=${MONGODB_AUTH_DB}") fi - if [[ -n "${MONGODB_SOCKET}" ]]; then + if [ -n "${MONGODB_SOCKET}" ]; then cmd+=("--socket=${MONGODB_SOCKET}") fi log "Running pmm-admin add mongodb..." @@ -605,10 +606,10 @@ add_valkey() { VALKEY_ADDRESS="${VALKEY_ADDRESS:-${VALKEY_HOST:-127.0.0.1}:${VALKEY_PORT:-6379}}" VALKEY_SERVICE_NAME="${VALKEY_SERVICE_NAME:-$(detect_node_hostname)-valkey}" local cmd=(pmm-admin add valkey "${VALKEY_SERVICE_NAME}" "${VALKEY_ADDRESS}" "--password=${VALKEY_PASSWORD}") - if [[ -n "${VALKEY_USERNAME}" ]]; then + if [ -n "${VALKEY_USERNAME}" ]; then cmd+=("--username=${VALKEY_USERNAME}") fi - if [[ -n "${VALKEY_SOCKET}" ]]; then + if [ -n "${VALKEY_SOCKET}" ]; then cmd+=("--socket=${VALKEY_SOCKET}") fi log "Running pmm-admin add valkey..." @@ -670,7 +671,7 @@ main() { add_service local rc=$? set -e - if [[ "${rc}" -ne 0 ]]; then + if [ "${rc}" -ne 0 ]; then report_add_service_failure "${rc}" fi log "PMM client setup completed successfully." diff --git a/ui/apps/pmm/src/router.tsx b/ui/apps/pmm/src/router.tsx index 0d9043c10e8..f59cc38de0b 100644 --- a/ui/apps/pmm/src/router.tsx +++ b/ui/apps/pmm/src/router.tsx @@ -48,7 +48,7 @@ const router = createBrowserRouter( { path: 'settings/:tab?', element: , - }, + }, { path: 'rta', children: [ From 0432a708b9116993f6471d61fe6712daccc1661c Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Fri, 15 May 2026 11:52:27 +0300 Subject: [PATCH 22/36] PMM-14993 Fix permissions on the script --- build/ansible/roles/nginx/files/install-pmm-client.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 build/ansible/roles/nginx/files/install-pmm-client.sh diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh old mode 100644 new mode 100755 From 3a05235caf1f1e1e7a6881103adcee6b3531aaab Mon Sep 17 00:00:00 2001 From: mattiasimonato Date: Mon, 18 May 2026 15:24:31 +0200 Subject: [PATCH 23/36] fix: pmm-admin config args when only node name is set --- build/ansible/roles/nginx/files/install-pmm-client.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh index b47ab1fb1a3..0c7138e0251 100755 --- a/build/ansible/roles/nginx/files/install-pmm-client.sh +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -493,11 +493,13 @@ configure_pmm_agent() { if [ "${PMM_SERVER_INSECURE_TLS}" = "1" ] || [ "${PMM_SERVER_INSECURE_TLS}" = "true" ]; then config_cmd+=(--server-insecure-tls) fi - if [ -n "${NODE_ADDRESS}" ]; then - config_cmd+=("${NODE_ADDRESS}") - fi + # pmm-admin config positionals are [] [] []. + # NODE_NAME without NODE_ADDRESS would shift "generic" into the address slot. if [ -n "${NODE_NAME}" ]; then - config_cmd+=("generic" "${NODE_NAME}") + local node_address="${NODE_ADDRESS:-$(detect_node_hostname)}" + config_cmd+=("${node_address}" "generic" "${NODE_NAME}") + elif [ -n "${NODE_ADDRESS}" ]; then + config_cmd+=("${NODE_ADDRESS}") fi if [ "${PMM_CONFIG_FORCE}" = "1" ] || [ "${PMM_CONFIG_FORCE}" = "true" ]; then config_cmd+=(--force) From b5fc814cc2a8a1e82bea29d16ae2ca4d9819e45b Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Mon, 18 May 2026 16:59:56 +0300 Subject: [PATCH 24/36] chore: remove redundant variable assignment --- build/ansible/roles/nginx/files/install-pmm-client.sh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh index 0c7138e0251..cc102747be4 100755 --- a/build/ansible/roles/nginx/files/install-pmm-client.sh +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -510,15 +510,6 @@ configure_pmm_agent() { } apply_generic_inputs() { - DB_USER="${DB_USER:-}" - DB_PASSWORD="${DB_PASSWORD:-}" - DB_HOST="${DB_HOST:-}" - DB_PORT="${DB_PORT:-}" - DB_ADDRESS="${DB_ADDRESS:-}" - DB_SERVICE_NAME="${DB_SERVICE_NAME:-}" - DB_AUTH_DB="${DB_AUTH_DB:-}" - DB_SOCKET="${DB_SOCKET:-}" - MYSQL_USERNAME="${MYSQL_USERNAME:-${DB_USER}}" MYSQL_PASSWORD="${MYSQL_PASSWORD:-${DB_PASSWORD}}" MYSQL_HOST="${MYSQL_HOST:-${DB_HOST}}" From c66cc9d2284524b58e14b150dd8df751a9f3d5ef Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Mon, 18 May 2026 17:03:47 +0300 Subject: [PATCH 25/36] fix: extend OS detection to include Rocky, AlmaLinux, CentOS, and Fedora --- build/ansible/roles/nginx/files/install-pmm-client.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh index cc102747be4..fee1ced7bc1 100755 --- a/build/ansible/roles/nginx/files/install-pmm-client.sh +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -226,7 +226,7 @@ detect_os_family() { echo "debian" return ;; - rhel|ol|amzn) + rhel|ol|amzn|rocky|almalinux|centos|fedora) echo "el" return ;; From f43069c92fe8ea9049f98904b0f91d04a3b55865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Silva?= Date: Tue, 19 May 2026 10:40:28 +0100 Subject: [PATCH 26/36] Fix: infinite ticking Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index c81d9b78ca6..0530f6fe1f1 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -52,12 +52,12 @@ export const InstallClientPage = () => { const [now, setNow] = useState(() => Date.now()); // Tick once a second while a token is live, so the countdown chip refreshes. - // Stops as soon as expiresAt is null (e.g. user cleared the field manually). + // Stops as soon as expiresAt is null or the token has expired. useEffect(() => { - if (!tokenExpiresAt) return undefined; + if (!tokenExpiresAt || isExpired) return undefined; const id = window.setInterval(() => setNow(Date.now()), 1000); return () => window.clearInterval(id); - }, [tokenExpiresAt]); + }, [tokenExpiresAt, isExpired]); const secondsLeft = tokenExpiresAt ? Math.max(0, Math.floor((tokenExpiresAt.getTime() - now) / 1000)) From cf24b9e49fe1df0b6cd557fca050202999cd2053 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 19 May 2026 09:48:29 +0000 Subject: [PATCH 27/36] ui: disable copy when clipboard API is unavailable Agent-Logs-Url: https://github.com/percona/pmm/sessions/171cec47-2b58-4382-a820-bbc69140fc34 Co-authored-by: fabio-silva <4190654+fabio-silva@users.noreply.github.com> --- .../install-client/InstallClientPage.tsx | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index 0530f6fe1f1..10c9a7e48f2 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -16,6 +16,7 @@ import { Stack, Switch, TextField, + Tooltip, Typography, } from '@mui/material'; import AccessTimeOutlinedIcon from '@mui/icons-material/AccessTimeOutlined'; @@ -79,6 +80,13 @@ export const InstallClientPage = () => { ); const serverURL = useMemo(() => buildPmmServerURL(pmmHost, token), [pmmHost, token]); + const clipboardAvailable = useMemo( + () => + typeof window !== 'undefined' && + window.isSecureContext && + typeof navigator.clipboard?.writeText === 'function', + [] + ); const command = useMemo( () => @@ -119,6 +127,7 @@ export const InstallClientPage = () => { ); const handleCopy = async () => { + if (!clipboardAvailable) return; await navigator.clipboard.writeText(command); setCopied(true); window.setTimeout(() => setCopied(false), 2000); @@ -390,9 +399,23 @@ export const InstallClientPage = () => { InputProps={{ readOnly: true }} /> - + + + + + {copied && Command copied.} From 20008d536a066e95b1505d2b8174a7172739b1fa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 19 May 2026 09:49:06 +0000 Subject: [PATCH 28/36] ui: rely on global interceptor for token generation errors Agent-Logs-Url: https://github.com/percona/pmm/sessions/171cec47-2b58-4382-a820-bbc69140fc34 Co-authored-by: fabio-silva <4190654+fabio-silva@users.noreply.github.com> --- .../pages/install-client/InstallClientPage.tsx | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index 10c9a7e48f2..97ba0b39be8 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -1,4 +1,3 @@ -import axios from 'axios'; import { useEffect, useMemo, useState } from 'react'; import { Alert, @@ -48,7 +47,6 @@ export const InstallClientPage = () => { const [dbServiceName, setDbServiceName] = useState(''); const [copied, setCopied] = useState(false); const [genLoading, setGenLoading] = useState(false); - const [genError, setGenError] = useState(null); const [tokenExpiresAt, setTokenExpiresAt] = useState(null); const [now, setNow] = useState(() => Date.now()); @@ -134,7 +132,6 @@ export const InstallClientPage = () => { }; const handleGenerateToken = async () => { - setGenError(null); setGenLoading(true); try { const res = await createNodeInstallToken(technology, 0); @@ -146,13 +143,8 @@ export const InstallClientPage = () => { : new Date(Date.now() + 15 * 60 * 1000); setTokenExpiresAt(expires); setNow(Date.now()); - } catch (e: unknown) { - let msg = 'Failed to create token'; - if (axios.isAxiosError(e)) { - const data = e.response?.data as { message?: string } | undefined; - msg = data?.message ?? e.message; - } - setGenError(msg); + } catch { + // Handled by global API error interceptor (toast notification). } finally { setGenLoading(false); } @@ -277,11 +269,6 @@ export const InstallClientPage = () => { size="medium" /> )} - {genError && ( - - {genError} - - )} Tokens are valid for 15 minutes after generation. Run the command on your node before From baa6584ff9506e2c466370e3246c858770f226dc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 19 May 2026 09:50:27 +0000 Subject: [PATCH 29/36] ui: memoize install page handlers with useCallback Agent-Logs-Url: https://github.com/percona/pmm/sessions/171cec47-2b58-4382-a820-bbc69140fc34 Co-authored-by: fabio-silva <4190654+fabio-silva@users.noreply.github.com> --- .../install-client/InstallClientPage.tsx | 147 +++++++++++++----- 1 file changed, 109 insertions(+), 38 deletions(-) diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index 97ba0b39be8..2c1b9d90883 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -1,4 +1,4 @@ -import { useEffect, useMemo, useState } from 'react'; +import { type ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react'; import { Alert, Box, @@ -21,6 +21,7 @@ import { import AccessTimeOutlinedIcon from '@mui/icons-material/AccessTimeOutlined'; import { Page } from 'components/page'; import { createNodeInstallToken } from 'api/installToken'; +import type { SelectChangeEvent } from '@mui/material/Select'; import { buildInstallCommand, buildPmmServerURL, @@ -49,14 +50,15 @@ export const InstallClientPage = () => { const [genLoading, setGenLoading] = useState(false); const [tokenExpiresAt, setTokenExpiresAt] = useState(null); const [now, setNow] = useState(() => Date.now()); + const refreshNow = useCallback(() => setNow(Date.now()), []); // Tick once a second while a token is live, so the countdown chip refreshes. // Stops as soon as expiresAt is null or the token has expired. useEffect(() => { if (!tokenExpiresAt || isExpired) return undefined; - const id = window.setInterval(() => setNow(Date.now()), 1000); + const id = window.setInterval(refreshNow, 1000); return () => window.clearInterval(id); - }, [tokenExpiresAt, isExpired]); + }, [tokenExpiresAt, isExpired, refreshNow]); const secondsLeft = tokenExpiresAt ? Math.max(0, Math.floor((tokenExpiresAt.getTime() - now) / 1000)) @@ -124,14 +126,14 @@ export const InstallClientPage = () => { ] ); - const handleCopy = async () => { + const handleCopy = useCallback(async () => { if (!clipboardAvailable) return; await navigator.clipboard.writeText(command); setCopied(true); window.setTimeout(() => setCopied(false), 2000); - }; + }, [clipboardAvailable, command]); - const handleGenerateToken = async () => { + const handleGenerateToken = useCallback(async () => { setGenLoading(true); try { const res = await createNodeInstallToken(technology, 0); @@ -142,13 +144,89 @@ export const InstallClientPage = () => { ? new Date(res.expiresAt) : new Date(Date.now() + 15 * 60 * 1000); setTokenExpiresAt(expires); - setNow(Date.now()); + refreshNow(); } catch { // Handled by global API error interceptor (toast notification). } finally { setGenLoading(false); } - }; + }, [refreshNow, technology]); + + const handleTechnologyChange = useCallback( + (e: SelectChangeEvent) => setTechnology(e.target.value as Technology), + [] + ); + + const handleCredentialsModeChange = useCallback( + (e: SelectChangeEvent) => + setCredentialsMode(e.target.value as CredentialsMode), + [] + ); + + const handlePmmHostChange = useCallback( + (e: ChangeEvent) => setPmmHost(e.target.value), + [] + ); + + const handleTokenChange = useCallback((e: ChangeEvent) => { + setToken(e.target.value); + setTokenExpiresAt(null); + }, []); + + const handleNodeNameChange = useCallback( + (e: ChangeEvent) => setNodeName(e.target.value), + [] + ); + + const handleNodeAddressChange = useCallback( + (e: ChangeEvent) => setNodeAddress(e.target.value), + [] + ); + + const handleDbUserChange = useCallback( + (e: ChangeEvent) => setDbUser(e.target.value), + [] + ); + + const handleDbPasswordChange = useCallback( + (e: ChangeEvent) => setDbPassword(e.target.value), + [] + ); + + const handleDbHostChange = useCallback( + (e: ChangeEvent) => setDbHost(e.target.value), + [] + ); + + const handleDbPortChange = useCallback( + (e: ChangeEvent) => setDbPort(e.target.value), + [] + ); + + const handleDbServiceNameChange = useCallback( + (e: ChangeEvent) => setDbServiceName(e.target.value), + [] + ); + + const handleDbNameChange = useCallback( + (e: ChangeEvent) => setDbName(e.target.value), + [] + ); + + const handleDbAuthDBChange = useCallback( + (e: ChangeEvent) => setDbAuthDB(e.target.value), + [] + ); + + const handleInsecureTLSChange = useCallback( + (e: ChangeEvent) => setInsecureTLS(e.target.checked), + [] + ); + + const handleRegisterForceChange = useCallback( + (e: ChangeEvent) => setRegisterForce(e.target.checked), + [] + ); return ( @@ -177,7 +255,7 @@ export const InstallClientPage = () => { labelId="technology-label" value={technology} label="Technology" - onChange={(e) => setTechnology(e.target.value as Technology)} + onChange={handleTechnologyChange} > MySQL PostgreSQL @@ -193,9 +271,7 @@ export const InstallClientPage = () => { labelId="credentials-mode-label" value={credentialsMode} label="Credentials mode" - onChange={(e) => - setCredentialsMode(e.target.value as CredentialsMode) - } + onChange={handleCredentialsModeChange} > Prompt on node (downloads script first, asks for DB user/password) @@ -218,7 +294,7 @@ export const InstallClientPage = () => { fullWidth label="PMM host" value={pmmHost} - onChange={(e) => setPmmHost(e.target.value)} + onChange={handlePmmHostChange} helperText="Hostname or hostname:port for PMM_SERVER_URL (defaults to this page if empty)" /> { type="password" label="Service token" value={token} - onChange={(e) => { - setToken(e.target.value); - // User edited the field manually — drop the expiry so we - // stop ticking against a token they overrode. - setTokenExpiresAt(null); - }} + onChange={handleTokenChange} error={isExpired} helperText={ isExpired @@ -280,13 +351,13 @@ export const InstallClientPage = () => { fullWidth label="Node name (optional)" value={nodeName} - onChange={(e) => setNodeName(e.target.value)} + onChange={handleNodeNameChange} /> setNodeAddress(e.target.value)} + onChange={handleNodeAddressChange} /> @@ -297,18 +368,18 @@ export const InstallClientPage = () => { ) : ( setDbUser(e.target.value)} - /> + fullWidth + label="DB user (optional)" + value={dbUser} + onChange={handleDbUserChange} + /> setDbPassword(e.target.value)} - /> + type="password" + label="DB password" + value={dbPassword} + onChange={handleDbPasswordChange} + /> )} @@ -317,19 +388,19 @@ export const InstallClientPage = () => { fullWidth label="DB host" value={dbHost} - onChange={(e) => setDbHost(e.target.value)} + onChange={handleDbHostChange} /> setDbPort(e.target.value)} + onChange={handleDbPortChange} /> setDbServiceName(e.target.value)} + onChange={handleDbServiceNameChange} /> @@ -338,7 +409,7 @@ export const InstallClientPage = () => { fullWidth label="PostgreSQL database (optional)" value={dbName} - onChange={(e) => setDbName(e.target.value)} + onChange={handleDbNameChange} /> )} {technology === 'mongodb' && ( @@ -346,7 +417,7 @@ export const InstallClientPage = () => { fullWidth label="MongoDB auth DB (optional)" value={dbAuthDB} - onChange={(e) => setDbAuthDB(e.target.value)} + onChange={handleDbAuthDBChange} /> )} @@ -355,7 +426,7 @@ export const InstallClientPage = () => { control={ setInsecureTLS(e.target.checked)} + onChange={handleInsecureTLSChange} /> } label="Use insecure TLS" @@ -364,7 +435,7 @@ export const InstallClientPage = () => { control={ setRegisterForce(e.target.checked)} + onChange={handleRegisterForceChange} /> } label="Force re-register node" From 67b39c1d1fb5c89e18d6e4d7074f57a2acd4e19d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 19 May 2026 10:11:54 +0000 Subject: [PATCH 30/36] ui: apply error interceptor to grafana api and restore genError Agent-Logs-Url: https://github.com/percona/pmm/sessions/583021bb-df4e-4016-8da7-3ddf0b35aa33 Co-authored-by: fabio-silva <4190654+fabio-silva@users.noreply.github.com> --- ui/apps/pmm/src/api/api.ts | 83 +++++++++++-------- .../install-client/InstallClientPage.tsx | 11 ++- 2 files changed, 58 insertions(+), 36 deletions(-) diff --git a/ui/apps/pmm/src/api/api.ts b/ui/apps/pmm/src/api/api.ts index 4c850f8de1e..fe39eea7cb6 100644 --- a/ui/apps/pmm/src/api/api.ts +++ b/ui/apps/pmm/src/api/api.ts @@ -15,47 +15,62 @@ export const grafanaApi = axios.create({ const DEFAULT_ERROR_MESSAGE = 'Something went wrong'; const MAX_ERROR_MESSAGE_LENGTH = 120; -let errorInterceptor: number | null = null; +let apiErrorInterceptor: number | null = null; +let grafanaApiErrorInterceptor: number | null = null; + +const onApiError = (error: AxiosError<{ message?: string }>) => { + if ( + error.response && + error.response.status >= 400 + ) { + let message = error.response.data?.message ?? DEFAULT_ERROR_MESSAGE; + let notificationsDisabled = + error.config?.disableNotifications ?? error.response.status === 429; + + if (typeof notificationsDisabled === 'function') { + notificationsDisabled = notificationsDisabled(error); + } + + if (!notificationsDisabled) { + message = message.trim(); + if (message.length > MAX_ERROR_MESSAGE_LENGTH) { + message = `${message.substring(0, MAX_ERROR_MESSAGE_LENGTH)}...`; + } + + enqueueSnackbar(message, { + variant: 'error', + preventDuplicate: true, + }); + } + } + + return Promise.reject(error); +}; export const addApiErrorInterceptor = () => { - if (errorInterceptor === null) { - errorInterceptor = api.interceptors.response.use( + if (apiErrorInterceptor === null) { + apiErrorInterceptor = api.interceptors.response.use( (response) => response, - (error: AxiosError<{ message?: string }>) => { - if ( - error.response && - error.response.status >= 400 - ) { - let message = error.response.data?.message ?? DEFAULT_ERROR_MESSAGE; - let notificationsDisabled = - error.config?.disableNotifications ?? error.response.status === 429; - - if (typeof notificationsDisabled === 'function') { - notificationsDisabled = notificationsDisabled(error); - } - - if (!notificationsDisabled) { - message = message.trim(); - if (message.length > MAX_ERROR_MESSAGE_LENGTH) { - message = `${message.substring(0, MAX_ERROR_MESSAGE_LENGTH)}...`; - } - - enqueueSnackbar(message, { - variant: 'error', - preventDuplicate: true, - }); - } - } - - return Promise.reject(error); - } + onApiError + ); + } + + if (grafanaApiErrorInterceptor === null) { + grafanaApiErrorInterceptor = grafanaApi.interceptors.response.use( + (response) => response, + onApiError ); } }; export const removeApiErrorInterceptor = () => { - if (errorInterceptor !== null) { - api.interceptors.response.eject(errorInterceptor); - errorInterceptor = null; + if (apiErrorInterceptor !== null) { + api.interceptors.response.eject(apiErrorInterceptor); + apiErrorInterceptor = null; + } + + if (grafanaApiErrorInterceptor !== null) { + grafanaApi.interceptors.response.eject(grafanaApiErrorInterceptor); + grafanaApiErrorInterceptor = null; } }; diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index 2c1b9d90883..dd41ce26cbd 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -48,6 +48,7 @@ export const InstallClientPage = () => { const [dbServiceName, setDbServiceName] = useState(''); const [copied, setCopied] = useState(false); const [genLoading, setGenLoading] = useState(false); + const [genError, setGenError] = useState(null); const [tokenExpiresAt, setTokenExpiresAt] = useState(null); const [now, setNow] = useState(() => Date.now()); const refreshNow = useCallback(() => setNow(Date.now()), []); @@ -134,6 +135,7 @@ export const InstallClientPage = () => { }, [clipboardAvailable, command]); const handleGenerateToken = useCallback(async () => { + setGenError(null); setGenLoading(true); try { const res = await createNodeInstallToken(technology, 0); @@ -145,8 +147,8 @@ export const InstallClientPage = () => { : new Date(Date.now() + 15 * 60 * 1000); setTokenExpiresAt(expires); refreshNow(); - } catch { - // Handled by global API error interceptor (toast notification). + } catch (error) { + setGenError(error instanceof Error ? error.message : 'Failed to create token'); } finally { setGenLoading(false); } @@ -340,6 +342,11 @@ export const InstallClientPage = () => { size="medium" /> )} + {genError && ( + + {genError} + + )} Tokens are valid for 15 minutes after generation. Run the command on your node before From 4bda5caf7e811a8b91e3110b92c1fd8c492a309b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Silva?= Date: Tue, 19 May 2026 11:21:32 +0100 Subject: [PATCH 31/36] chore: improve script for presence check Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- build/ansible/roles/nginx/files/install-pmm-client.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh index fee1ced7bc1..180de06a383 100755 --- a/build/ansible/roles/nginx/files/install-pmm-client.sh +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -364,12 +364,14 @@ ensure_pmm_agent_config_file() { } start_pmm_agent_systemd() { - if ! systemctl list-unit-files pmm-agent.service >/dev/null 2>&1; then + if ! systemctl cat pmm-agent.service >/dev/null 2>&1; then return 1 fi log "Starting pmm-agent via systemd..." systemctl daemon-reload >/dev/null 2>&1 || true - systemctl enable --now pmm-agent.service + if ! systemctl enable --now pmm-agent.service; then + return 1 + fi } start_pmm_agent_nohup() { From f8943326fa0d5acf5179f69e7b4fe512174dc18f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Silva?= Date: Tue, 19 May 2026 11:23:00 +0100 Subject: [PATCH 32/36] fix: permissions Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- build/ansible/roles/nginx/files/install-pmm-client.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh index 180de06a383..1349fd24a56 100755 --- a/build/ansible/roles/nginx/files/install-pmm-client.sh +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -358,9 +358,13 @@ ensure_pmm_agent_config_file() { fi if [ ! -e "${PMM_AGENT_CONFIG_FILE}" ]; then : > "${PMM_AGENT_CONFIG_FILE}" - chmod 0660 "${PMM_AGENT_CONFIG_FILE}" || true log "Created empty pmm-agent config: ${PMM_AGENT_CONFIG_FILE}" fi + chmod 0660 "${PMM_AGENT_CONFIG_FILE}" || true + if id -u pmm-agent >/dev/null 2>&1; then + chown pmm-agent:pmm-agent "${PMM_AGENT_CONFIG_FILE}" 2>/dev/null || \ + chown pmm-agent "${PMM_AGENT_CONFIG_FILE}" 2>/dev/null || true + fi } start_pmm_agent_systemd() { From cfb9b89f30277ac1f09567b35f92cc87593e687b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 19 May 2026 10:37:45 +0000 Subject: [PATCH 33/36] ui: compute isExpired before interval effect usage Agent-Logs-Url: https://github.com/percona/pmm/sessions/8a4da2e1-973b-4cc4-b28f-2293caa68d81 Co-authored-by: fabio-silva <4190654+fabio-silva@users.noreply.github.com> --- .../pmm/src/pages/install-client/InstallClientPage.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index dd41ce26cbd..610df60bd7b 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -53,6 +53,11 @@ export const InstallClientPage = () => { const [now, setNow] = useState(() => Date.now()); const refreshNow = useCallback(() => setNow(Date.now()), []); + const secondsLeft = tokenExpiresAt + ? Math.max(0, Math.floor((tokenExpiresAt.getTime() - now) / 1000)) + : 0; + const isExpired = !!tokenExpiresAt && secondsLeft <= 0; + // Tick once a second while a token is live, so the countdown chip refreshes. // Stops as soon as expiresAt is null or the token has expired. useEffect(() => { @@ -61,11 +66,6 @@ export const InstallClientPage = () => { return () => window.clearInterval(id); }, [tokenExpiresAt, isExpired, refreshNow]); - const secondsLeft = tokenExpiresAt - ? Math.max(0, Math.floor((tokenExpiresAt.getTime() - now) / 1000)) - : 0; - const isExpired = !!tokenExpiresAt && secondsLeft <= 0; - // When the timer hits zero, drop the secret so the rendered command falls // back to the placeholder. We deliberately keep `tokenExpiresAt` set so the // chip can still show "Expired — regenerate" until the user acts. From 877b995d2d98a52645a9018da31f29ebefae28d4 Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Tue, 19 May 2026 15:17:40 +0300 Subject: [PATCH 34/36] fix: the removal of the static directory --- build/ansible/pmm-docker/post-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/ansible/pmm-docker/post-build.yml b/build/ansible/pmm-docker/post-build.yml index dadddb1ec39..351034b4a83 100644 --- a/build/ansible/pmm-docker/post-build.yml +++ b/build/ansible/pmm-docker/post-build.yml @@ -53,7 +53,7 @@ - nomad-server.ini - name: Clean pmm-server dir - shell: find /usr/share/pmm-server -mindepth 1 -maxdepth 1 -print0 | xargs -0 rm -rf -- + shell: find /usr/share/pmm-server -mindepth 1 -maxdepth 1 -not -name "static" -print0 | xargs -0 rm -rf -- - name: Clean /srv directory for fresh initialization on first start file: From 90156cc4397f5170070c7b282bc8032a3e699fc2 Mon Sep 17 00:00:00 2001 From: theTibi Date: Thu, 21 May 2026 05:54:25 -0500 Subject: [PATCH 35/36] Enhance PMM client installation script and UI - Updated `install-pmm-client.sh` to include detailed descriptions for the `--force` and `--db-service-name` options, and added support for `--db-query-source`. - Improved documentation for the one-step installation process, clarifying the use of environment variables and advanced options. - Enhanced the Install Client UI to support MySQL query source selection and added a learn more section for better user guidance. - Updated utility functions to handle MySQL query sources and suggested service names based on user input. This update aims to streamline the installation process and improve user experience when configuring PMM clients. Signed-off-by: theTibi --- .../roles/nginx/files/install-pmm-client.sh | 171 ++++++- .../install-pmm-client/one-step-ui-install.md | 66 ++- .../install-client/InstallClientPage.tsx | 456 +++++++++++------- .../InstallClientPage.utils.test.ts | 66 +++ .../install-client/InstallClientPage.utils.ts | 66 +++ 5 files changed, 624 insertions(+), 201 deletions(-) diff --git a/build/ansible/roles/nginx/files/install-pmm-client.sh b/build/ansible/roles/nginx/files/install-pmm-client.sh index 1349fd24a56..48baf9dacac 100755 --- a/build/ansible/roles/nginx/files/install-pmm-client.sh +++ b/build/ansible/roles/nginx/files/install-pmm-client.sh @@ -21,7 +21,7 @@ Global options: --tech TECH One of: mysql, postgresql, mongodb, valkey --node-name NAME Node name for pmm-admin config --node-address ADDRESS Node address for pmm-admin config - --force Pass --force to pmm-admin config (removes existing node name and its services on the server, then registers again) + --force Pass --force to pmm-admin config (removes existing node name and its services on the server, then registers again). When omitted, pmm-admin config is skipped automatically if pmm-agent is already set up on this node. Generic DB options (mapped per technology): --db-user USER @@ -30,16 +30,18 @@ Generic DB options (mapped per technology): --db-port PORT --db-name NAME DB name for PostgreSQL --db-address HOST:PORT Explicit service address - --db-service-name NAME PMM service name + --db-service-name NAME PMM service name (default: -, with - or - suffix when the port is non-default, --db-port is set, or a socket path is used) --db-auth-db NAME MongoDB auth database --db-socket PATH Socket path for MySQL/PostgreSQL/MongoDB/Valkey + --db-query-source SOURCE MySQL QAN source: slowlog, perfschema, or none (passed to pmm-admin add mysql as --query-source; default: pmm-admin default slowlog) Environment variables are also supported. Priority is: flags > env vars > interactive prompt. When stdin is a terminal, database prompts are skipped if credentials are already set from flags or environment (DB_USER / DB_PASSWORD and per-tech MYSQL_*, -POSTGRESQL_* / … after apply_generic_inputs). Use sudo -E bash … when running -as root so your exports reach the script. +POSTGRESQL_* / … after apply_generic_inputs). MYSQL_QUERY_SOURCE overrides +DB_QUERY_SOURCE for MySQL. Use sudo -E bash … when running as root so your +exports reach the script. pmm-agent runtime knobs (env only): PMM_AGENT_CONFIG_FILE Path to pmm-agent.yaml (default: /usr/local/percona/pmm/config/pmm-agent.yaml) @@ -56,6 +58,7 @@ TECH="${TECH:-}" NODE_NAME="${NODE_NAME:-}" NODE_ADDRESS="${NODE_ADDRESS:-}" PMM_CONFIG_FORCE="${PMM_CONFIG_FORCE:-0}" +PMM_CONFIG_SKIPPED=0 DB_USER="${DB_USER:-}" DB_PASSWORD="${DB_PASSWORD:-}" @@ -66,6 +69,7 @@ DB_ADDRESS="${DB_ADDRESS:-}" DB_SERVICE_NAME="${DB_SERVICE_NAME:-}" DB_AUTH_DB="${DB_AUTH_DB:-}" DB_SOCKET="${DB_SOCKET:-}" +DB_QUERY_SOURCE="${DB_QUERY_SOURCE:-}" MYSQL_USERNAME="${MYSQL_USERNAME:-}" MYSQL_PASSWORD="${MYSQL_PASSWORD:-}" @@ -74,6 +78,7 @@ MYSQL_PORT="${MYSQL_PORT:-}" MYSQL_ADDRESS="${MYSQL_ADDRESS:-}" MYSQL_SERVICE_NAME="${MYSQL_SERVICE_NAME:-}" MYSQL_SOCKET="${MYSQL_SOCKET:-}" +MYSQL_QUERY_SOURCE="${MYSQL_QUERY_SOURCE:-}" POSTGRESQL_USERNAME="${POSTGRESQL_USERNAME:-}" POSTGRESQL_PASSWORD="${POSTGRESQL_PASSWORD:-}" @@ -176,6 +181,10 @@ while [ $# -gt 0 ]; do DB_SOCKET="${2:-}" shift 2 ;; + --db-query-source) + DB_QUERY_SOURCE="${2:-}" + shift 2 + ;; *) error "Unknown option: $1. Use --help for usage." ;; @@ -489,10 +498,76 @@ require_db_creds_before_config_if_noninteractive() { esac } +# True when pmm-agent is running and has registered with PMM Server locally. +# Returns false when --force is set (caller should run pmm-admin config). +pmm_agent_already_configured() { + if [ "${PMM_CONFIG_FORCE}" = "1" ] || [ "${PMM_CONFIG_FORCE}" = "true" ]; then + return 1 + fi + if ! command -v pmm-admin >/dev/null 2>&1; then + return 1 + fi + if ! pmm_agent_listening; then + return 1 + fi + local agent_id + agent_id="$(pmm-admin status 2>/dev/null | sed -n 's/^Agent ID *: *\(.*\)/\1/p' | head -1 | tr -d '[:space:]')" + [ -n "${agent_id}" ] +} + +# Port from a host:port address (empty when no colon is present). +extract_port_from_address() { + local address="$1" + case "${address}" in + *:*) + printf '%s' "${address##*:}" + ;; + esac +} + +# Disambiguator for default service names, e.g. "-3307" or "-mysql2" (socket basename). +service_name_disambiguator() { + local default_port="$1" + local port="$2" + local port_explicit="$3" + local socket="$4" + local effective="${port:-${default_port}}" + + if [ -n "${socket}" ]; then + local sock_id="${socket##*/}" + sock_id="${sock_id%.sock}" + printf '-%s' "${sock_id}" + return + fi + + if [ "${port_explicit}" = "1" ] || [ "${effective}" != "${default_port}" ]; then + printf '-%s' "${effective}" + fi +} + +default_db_service_name() { + local tech_label="$1" + local default_port="$2" + local port="$3" + local port_explicit="$4" + local socket="$5" + local suffix + suffix="$(service_name_disambiguator "${default_port}" "${port}" "${port_explicit}" "${socket}")" + printf '%s-%s%s' "$(detect_node_hostname)" "${tech_label}" "${suffix}" +} + configure_pmm_agent() { - prompt_if_empty PMM_SERVER_URL "PMM server URL (example: https://service_token:GLSA_TOKEN@pmm.example.com:443)" 1 prompt_if_empty TECH "Technology to add (mysql/postgresql/mongodb/valkey)" + if pmm_agent_already_configured; then + log "pmm-agent is already configured with PMM Server; skipping pmm-admin config." + log "Use --force to re-register the node (removes the existing node and its services on the server)." + PMM_CONFIG_SKIPPED=1 + return 0 + fi + + prompt_if_empty PMM_SERVER_URL "PMM server URL (example: https://service_token:GLSA_TOKEN@pmm.example.com:443)" 1 + require_db_creds_before_config_if_noninteractive local config_cmd=(pmm-admin config "--server-url=${PMM_SERVER_URL}") @@ -523,6 +598,7 @@ apply_generic_inputs() { MYSQL_ADDRESS="${MYSQL_ADDRESS:-${DB_ADDRESS}}" MYSQL_SERVICE_NAME="${MYSQL_SERVICE_NAME:-${DB_SERVICE_NAME}}" MYSQL_SOCKET="${MYSQL_SOCKET:-${DB_SOCKET}}" + MYSQL_QUERY_SOURCE="${MYSQL_QUERY_SOURCE:-${DB_QUERY_SOURCE}}" POSTGRESQL_USERNAME="${POSTGRESQL_USERNAME:-${DB_USER}}" POSTGRESQL_PASSWORD="${POSTGRESQL_PASSWORD:-${DB_PASSWORD}}" @@ -551,16 +627,42 @@ apply_generic_inputs() { VALKEY_SOCKET="${VALKEY_SOCKET:-${DB_SOCKET}}" } +validate_mysql_query_source() { + case "${MYSQL_QUERY_SOURCE}" in + slowlog|perfschema|none) + ;; + '') + ;; + *) + error "Unsupported MySQL query source '${MYSQL_QUERY_SOURCE}'. Supported: slowlog, perfschema, none." + ;; + esac +} + add_mysql() { local db_cred_hint='Use --db-user and --db-password, or set DB_USER and DB_PASSWORD (MYSQL_* overrides if set). If you use sudo env, list DB_USER and DB_PASSWORD there; exports in your shell are not passed to the script.' prompt_if_empty MYSQL_USERNAME "MySQL username" 0 "${db_cred_hint}" prompt_if_empty MYSQL_PASSWORD "MySQL password" 1 "${db_cred_hint}" + local port_explicit=0 + if [ -n "${DB_PORT}" ] || [ -n "${MYSQL_PORT}" ]; then + port_explicit=1 + fi + if [ -z "${MYSQL_PORT}" ] && [ -n "${MYSQL_ADDRESS}" ]; then + MYSQL_PORT="$(extract_port_from_address "${MYSQL_ADDRESS}")" + fi MYSQL_ADDRESS="${MYSQL_ADDRESS:-${MYSQL_HOST:-127.0.0.1}:${MYSQL_PORT:-3306}}" - MYSQL_SERVICE_NAME="${MYSQL_SERVICE_NAME:-$(detect_node_hostname)-mysql}" + if [ -z "${MYSQL_PORT}" ]; then + MYSQL_PORT="$(extract_port_from_address "${MYSQL_ADDRESS}")" + fi + MYSQL_SERVICE_NAME="${MYSQL_SERVICE_NAME:-$(default_db_service_name mysql 3306 "${MYSQL_PORT}" "${port_explicit}" "${MYSQL_SOCKET}")}" + validate_mysql_query_source local cmd=(pmm-admin add mysql "${MYSQL_SERVICE_NAME}" "${MYSQL_ADDRESS}" "--username=${MYSQL_USERNAME}" "--password=${MYSQL_PASSWORD}") if [ -n "${MYSQL_SOCKET}" ]; then cmd+=("--socket=${MYSQL_SOCKET}") fi + if [ -n "${MYSQL_QUERY_SOURCE}" ]; then + cmd+=("--query-source=${MYSQL_QUERY_SOURCE}") + fi log "Running pmm-admin add mysql..." "${cmd[@]}" } @@ -569,8 +671,18 @@ add_postgresql() { local db_cred_hint='Use --db-user and --db-password, or set DB_USER and DB_PASSWORD (POSTGRESQL_* overrides if set). If you use sudo env, list DB_USER and DB_PASSWORD there; exports in your shell are not passed to the script.' prompt_if_empty POSTGRESQL_USERNAME "PostgreSQL username" 0 "${db_cred_hint}" prompt_if_empty POSTGRESQL_PASSWORD "PostgreSQL password" 1 "${db_cred_hint}" + local port_explicit=0 + if [ -n "${DB_PORT}" ] || [ -n "${POSTGRESQL_PORT}" ]; then + port_explicit=1 + fi + if [ -z "${POSTGRESQL_PORT}" ] && [ -n "${POSTGRESQL_ADDRESS}" ]; then + POSTGRESQL_PORT="$(extract_port_from_address "${POSTGRESQL_ADDRESS}")" + fi POSTGRESQL_ADDRESS="${POSTGRESQL_ADDRESS:-${POSTGRESQL_HOST:-127.0.0.1}:${POSTGRESQL_PORT:-5432}}" - POSTGRESQL_SERVICE_NAME="${POSTGRESQL_SERVICE_NAME:-$(detect_node_hostname)-postgresql}" + if [ -z "${POSTGRESQL_PORT}" ]; then + POSTGRESQL_PORT="$(extract_port_from_address "${POSTGRESQL_ADDRESS}")" + fi + POSTGRESQL_SERVICE_NAME="${POSTGRESQL_SERVICE_NAME:-$(default_db_service_name postgresql 5432 "${POSTGRESQL_PORT}" "${port_explicit}" "${POSTGRESQL_SOCKET}")}" local cmd=(pmm-admin add postgresql "${POSTGRESQL_SERVICE_NAME}" "${POSTGRESQL_ADDRESS}" "--username=${POSTGRESQL_USERNAME}" "--password=${POSTGRESQL_PASSWORD}") if [ -n "${POSTGRESQL_DATABASE}" ]; then cmd+=("--database=${POSTGRESQL_DATABASE}") @@ -586,8 +698,18 @@ add_mongodb() { local db_cred_hint='Use --db-user and --db-password, or set DB_USER and DB_PASSWORD (MONGODB_* overrides if set). If you use sudo env, list DB_USER and DB_PASSWORD there; exports in your shell are not passed to the script.' prompt_if_empty MONGODB_USERNAME "MongoDB username" 0 "${db_cred_hint}" prompt_if_empty MONGODB_PASSWORD "MongoDB password" 1 "${db_cred_hint}" + local port_explicit=0 + if [ -n "${DB_PORT}" ] || [ -n "${MONGODB_PORT}" ]; then + port_explicit=1 + fi + if [ -z "${MONGODB_PORT}" ] && [ -n "${MONGODB_ADDRESS}" ]; then + MONGODB_PORT="$(extract_port_from_address "${MONGODB_ADDRESS}")" + fi MONGODB_ADDRESS="${MONGODB_ADDRESS:-${MONGODB_HOST:-127.0.0.1}:${MONGODB_PORT:-27017}}" - MONGODB_SERVICE_NAME="${MONGODB_SERVICE_NAME:-$(detect_node_hostname)-mongodb}" + if [ -z "${MONGODB_PORT}" ]; then + MONGODB_PORT="$(extract_port_from_address "${MONGODB_ADDRESS}")" + fi + MONGODB_SERVICE_NAME="${MONGODB_SERVICE_NAME:-$(default_db_service_name mongodb 27017 "${MONGODB_PORT}" "${port_explicit}" "${MONGODB_SOCKET}")}" local cmd=(pmm-admin add mongodb "${MONGODB_SERVICE_NAME}" "${MONGODB_ADDRESS}" "--username=${MONGODB_USERNAME}" "--password=${MONGODB_PASSWORD}") if [ -n "${MONGODB_AUTH_DB}" ]; then cmd+=("--authentication-database=${MONGODB_AUTH_DB}") @@ -602,8 +724,18 @@ add_mongodb() { add_valkey() { local db_cred_hint='Use --db-password or DB_PASSWORD (VALKEY_PASSWORD overrides if set). If you use sudo env, list DB_PASSWORD there; exports in your shell are not passed to the script.' prompt_if_empty VALKEY_PASSWORD "Valkey password" 1 "${db_cred_hint}" + local port_explicit=0 + if [ -n "${DB_PORT}" ] || [ -n "${VALKEY_PORT}" ]; then + port_explicit=1 + fi + if [ -z "${VALKEY_PORT}" ] && [ -n "${VALKEY_ADDRESS}" ]; then + VALKEY_PORT="$(extract_port_from_address "${VALKEY_ADDRESS}")" + fi VALKEY_ADDRESS="${VALKEY_ADDRESS:-${VALKEY_HOST:-127.0.0.1}:${VALKEY_PORT:-6379}}" - VALKEY_SERVICE_NAME="${VALKEY_SERVICE_NAME:-$(detect_node_hostname)-valkey}" + if [ -z "${VALKEY_PORT}" ]; then + VALKEY_PORT="$(extract_port_from_address "${VALKEY_ADDRESS}")" + fi + VALKEY_SERVICE_NAME="${VALKEY_SERVICE_NAME:-$(default_db_service_name valkey 6379 "${VALKEY_PORT}" "${port_explicit}" "${VALKEY_SOCKET}")}" local cmd=(pmm-admin add valkey "${VALKEY_SERVICE_NAME}" "${VALKEY_ADDRESS}" "--password=${VALKEY_PASSWORD}") if [ -n "${VALKEY_USERNAME}" ]; then cmd+=("--username=${VALKEY_USERNAME}") @@ -617,7 +749,7 @@ add_valkey() { add_service() { # IMPORTANT: keep this list in sync with: - # - installTokenTechnologies in managed/services/management/install_token.go + # - SUPPORTED_TECHNOLOGIES in ui/apps/pmm/src/api/installToken.ts # - the Technology union in ui/apps/pmm/src/pages/install-client/InstallClientPage.utils.ts # If you add a tech here, also add a matching add_ function above and the require_* # branch in require_db_creds_before_config_if_noninteractive. @@ -640,19 +772,22 @@ add_service() { esac } -# Print a tailored recovery hint when `pmm-admin add` fails after `pmm-admin config` -# has already registered the node. The most common cause we see in the field is -# wrong DB credentials; the second most common is leftover state from a previous -# attempt. Either way the user wants `--force` on the next run + corrected creds. +# Print a tailored recovery hint when `pmm-admin add` fails. report_add_service_failure() { local exit_code="$1" echo >&2 - log "ERROR: 'pmm-admin add ${TECH}' failed (exit ${exit_code}) after the node was already registered with PMM Server." - log " The node is now visible on PMM Server but no service is attached to it." + log "ERROR: 'pmm-admin add ${TECH}' failed (exit ${exit_code})." log " Most common causes:" log " * Wrong DB credentials → fix DB_USER / DB_PASSWORD (or --db-user / --db-password) and re-run." - log " * Service already attached from a prior attempt → re-run with --force (or PMM_CONFIG_FORCE=1)" - log " which removes the previous node registration and its services on the server before re-registering." + if [ "${PMM_CONFIG_SKIPPED}" = "1" ]; then + log " * Service name already in use on this node → set a unique --db-service-name or a" + log " different --db-port so the script default name includes a port suffix." + log " Do not use --force here; that removes the node and all existing services." + else + log " * The node was registered but no service was added → fix credentials or service" + log " options and re-run. To replace the node registration entirely, use --force" + log " (removes the node and its services on PMM Server before re-registering)." + fi log " For MongoDB also check --db-auth-db / DB_AUTH_DB; for PostgreSQL check --db-name / DB_NAME." exit "${exit_code}" } diff --git a/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md b/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md index cf4dd2dfb3d..7992b7d61e4 100644 --- a/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md +++ b/documentation/docs/install-pmm/install-pmm-client/one-step-ui-install.md @@ -11,14 +11,29 @@ Use the **Install PMM Client** wizard to generate a single command that installs ## Generate the command 1. In PMM UI, open **Inventory → Install PMM Client**. -2. Choose technology: `MySQL`, `PostgreSQL`, `MongoDB`, or `Valkey`. +2. Choose **Technology**: `MySQL`, `PostgreSQL`, `MongoDB`, or `Valkey`. 3. Click **Generate short-lived token**. The countdown chip shows the remaining lifetime. -4. Select the credentials mode: - - **Prompt on node (downloads script first, asks for DB user/password)** (**default**): the wizard renders a **two-step** command — `curl … -o /tmp/install-pmm-client.sh ''` followed by `sudo -E bash /tmp/install-pmm-client.sh …`. Reading the script from disk (instead of piping it from `curl`) keeps stdin attached to your terminal, so the script can prompt you for the DB user and password. **`sudo -E`** preserves your environment into the root shell: if `DB_USER` / `DB_PASSWORD` (or per-tech `MYSQL_*`, `POSTGRESQL_*`, …) are already exported, the script uses them and **does not prompt**. Use this when you do not want credentials in the copied command line or process list from flags alone. - - **Include env variables (recommended for `curl | bash`)**: credentials are passed in the environment of the spawned shell. Use this when you want the classic one-liner pipeline. - - **Pass as script flags**: credentials are passed as `--db-*` script arguments instead of env vars. Same security profile as env mode, just a different surface. -5. Fill in the optional fields you need (node name/address, DB host/port, service name, MongoDB auth DB, PostgreSQL database). -6. Copy the generated command and run it on the target node before the token expires. +4. Copy the **Generated command** and run it on your database server with `sudo` before the token expires. By default the command uses **prompt on node** mode: the script downloads to `/tmp/install-pmm-client.sh`, then asks for the DB user and password on the server (they are not embedded in the command). +5. Optional — open **Advanced options** for node name/address, DB host/port, service name, MySQL query source (QAN), PostgreSQL database, MongoDB auth DB, or **Use insecure TLS**. +6. Optional — enable **Running in CI/automation?** if you need credentials embedded in the command instead of prompted on the node: + - **Include env variables** (recommended for `curl | bash`): credentials in the environment of the spawned shell. + - **Pass as script flags**: credentials as `--db-user` / `--db-password` script arguments. + - **Prompt on node** remains available here for automation that still allocates a TTY. + +**Advanced options** also contains **Force re-register node** — use only to recover from a broken first install (it removes the existing node and all its services on PMM Server). Do not enable it when adding another database instance on the same host. + +Example (env mode, MySQL with Performance Schema QAN): + +```bash +curl -fsSLk 'https:///pmm-static/install-pmm-client.sh' | sudo -E env \ + PMM_SERVER_URL='https://service_token:@' \ + TECH='mysql' \ + DB_USER='pmm' \ + DB_PASSWORD='secret' \ + DB_QUERY_SOURCE='perfschema' \ + bash -s -- \ + --pmm-server-insecure-tls +``` Example (env mode, matches what the wizard renders): @@ -42,7 +57,7 @@ sudo -E bash '/tmp/install-pmm-client.sh' \ --pmm-server-insecure-tls ``` -The second line runs `bash` against a file (not against a pipe), so `sudo` keeps stdin connected to your terminal. The script then asks twice — once for the DB user, once for the DB password (silent input) — before running `pmm-admin add`. Optional fields you fill in the wizard (host, port, service name, MongoDB auth DB, PostgreSQL database) are still passed as `--db-*` flags so you only have to type two things. +The second line runs `bash` against a file (not against a pipe), so `sudo` keeps stdin connected to your terminal. The script then asks twice — once for the DB user, once for the DB password (silent input) — before running `pmm-admin add`. Fields you set under **Advanced options** (host, port, service name, MySQL query source, MongoDB auth DB, PostgreSQL database) are passed as `--db-*` flags so you only have to type two things on the node. Notes on the rendered command: @@ -57,13 +72,40 @@ The script available at `/pmm-static/install-pmm-client.sh` performs: 1. Installs `pmm-client` using the OS package manager (RHEL-compatible or Debian-compatible hosts). 2. Ensures `pmm-agent` is running (starts it via `systemd` when available, otherwise `nohup` in the background). -3. Runs `pmm-admin config` against your PMM server to register the node and persist the agent identity. +3. Runs `pmm-admin config` against your PMM server to register the node and persist the agent identity — **skipped automatically** when `pmm-agent` is already set up on the node (use **Force re-register node** / `--force` only when you need to replace the existing registration). 4. Runs `pmm-admin add ` using your selected options. +When **Service name** is left empty in the wizard, the script picks `-` (for example `db1-mysql`). If you set **DB port** (or the effective port is not the technology default), the script appends `-` (for example `db1-mysql-3307`) so multiple instances on one node get distinct names. + +For **MySQL**, set **Query source (QAN)** to `slowlog`, `perfschema`, or `none`. The script passes it to `pmm-admin add mysql` as `--query-source`. When omitted, `pmm-admin` uses its default (`slowlog`). See [Connect MySQL databases to PMM](connect-database/mysql/mysql.md#quick-setup) for permission requirements per source. + +## Multiple database instances on one node + +Use the wizard **once per instance** on the same host: + +1. **First instance** — generate a token and run the full command (install, register node, add service). Include **PMM host**, token, and credentials as usual. +2. **Additional instances** — generate a new token, set a different **DB port** (and credentials if they differ), and run the command again on the same node. You do **not** need **Force re-register node**; the script detects an already-configured `pmm-agent` and skips `pmm-admin config`, then runs only `pmm-admin add`. +3. Leave **Service name** empty unless you want a custom name — the script suffixes the port when needed to avoid name clashes. + +Example — second MySQL on port `3307` (prompt mode; DB credentials are prompted on the node): + +```bash +curl -fsSLk -o '/tmp/install-pmm-client.sh' 'https:///pmm-static/install-pmm-client.sh' +sudo -E bash '/tmp/install-pmm-client.sh' \ + --pmm-server-url 'https://service_token:@' \ + --tech 'mysql' \ + --db-port '3307' \ + --pmm-server-insecure-tls +``` + +After the first run, `pmm-admin config` is skipped even though the command still includes `--pmm-server-url` (required for the first run and harmless on later runs). For additional instances you may omit `--pmm-server-url` if you build the command by hand. + +**Warning:** **Force re-register node** (`--force`) removes the existing node **and all services** on PMM Server before registering again. Use it only to recover from a broken first registration — not when adding another database instance. + ## Security notes - Generated tokens are tied to Grafana service accounts minted as **Admin** org role and live for **15 minutes** — generate, run, done. There is no way to extend the lifetime from the UI. -- Env mode and flags mode put credentials into the shell command line and the spawned process environment. On a shared node, that may be visible in `ps`/`/proc` to other users for a moment. **Prompt mode** avoids this entirely: the rendered command never contains the DB user or password, and the script reads them straight from your terminal once it is running on the node. +- The default **prompt on node** flow keeps DB credentials off the clipboard. Enable **Running in CI/automation?** only when you need env/flags mode; credentials may then appear in the command line or process environment briefly on the target node. - Avoid copy-pasting the command into chat/issue trackers; the embedded service token is a credential. (In prompt mode the DB credentials are not in the command, but the PMM service token still is.) ## Troubleshooting @@ -72,8 +114,8 @@ The script available at `/pmm-static/install-pmm-client.sh` performs: - **TLS handshake errors against PMM Server** — turn on **Use insecure TLS** in the wizard (sets the `--pmm-server-insecure-tls` script flag). The wizard also adds `-k` to `curl` so the script download itself succeeds. - **Package install fails** — verify outbound access to the Percona repositories (`repo.percona.com`). -- **`pmm-admin add` fails (auth, name conflict, etc.)** — the node was already registered by `pmm-admin config`. Re-run with **Force re-register node** enabled (this passes `--force` to `pmm-admin config`, which removes the previous node and its services on the server before re-registering). You may also have to fix the database credentials before retrying. +- **`pmm-admin add` fails (auth, name conflict, etc.)** — on the **first** run, the node was already registered by `pmm-admin config`. Re-run with **Force re-register node** enabled (this passes `--force` to `pmm-admin config`, which removes the previous node and its services on the server before re-registering). You may also have to fix the database credentials before retrying. On **additional instances** on an already-registered node, a name conflict usually means the service name collides — set a unique **Service name** or a distinct **DB port** so the script default includes a port suffix. - **`pmm-agent is not running`** — happens in containers without `systemd`. The script auto-starts it via `nohup` and writes logs to `/var/log/pmm-agent.log`; check there. - **`hostname: command not found`** — only on extremely minimal images; the script falls back to `$HOSTNAME`/`uname -n`/`/etc/hostname` and finally `node`. -- **Prompt mode does not actually prompt** — the script's noninteractive guard fires when stdin is not a TTY, e.g. when the prompt-mode command is invoked through `ssh host ''` (no allocated TTY) or through automation. Run it from an interactive shell on the node, or use **Include env variables** / **Pass as script flags** mode instead. +- **Prompt mode does not actually prompt** — the script's noninteractive guard fires when stdin is not a TTY, e.g. when the prompt-mode command is invoked through `ssh host ''` (no allocated TTY) or through automation. Run it from an interactive shell on the node, or enable **Running in CI/automation?** and use **Include env variables** / **Pass as script flags** instead. - **Cleanup after prompt mode** — the downloaded script lives at `/tmp/install-pmm-client.sh` after a successful install. It is harmless (no embedded secrets), but if you want it gone: `rm -f /tmp/install-pmm-client.sh`. diff --git a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx index 610df60bd7b..ed393413696 100644 --- a/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx +++ b/ui/apps/pmm/src/pages/install-client/InstallClientPage.tsx @@ -1,15 +1,20 @@ import { type ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react'; import { + Accordion, + AccordionDetails, + AccordionSummary, Alert, Box, Button, Card, CardContent, Chip, + Collapse, FormControl, FormControlLabel, FormHelperText, InputLabel, + Link, MenuItem, Select, Stack, @@ -19,6 +24,7 @@ import { Typography, } from '@mui/material'; import AccessTimeOutlinedIcon from '@mui/icons-material/AccessTimeOutlined'; +import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import { Page } from 'components/page'; import { createNodeInstallToken } from 'api/installToken'; import type { SelectChangeEvent } from '@mui/material/Select'; @@ -27,12 +33,20 @@ import { buildPmmServerURL, CredentialsMode, formatExpiresIn, + suggestDbServiceName, Technology, + MYSQL_QUERY_SOURCES, + type MySQLQuerySource, } from './InstallClientPage.utils'; +const INSTALL_DOCS_URL = + 'https://docs.percona.com/percona-monitoring-and-management/3/install-pmm/install-pmm-client/one-step-ui-install.html'; + export const InstallClientPage = () => { const [technology, setTechnology] = useState('mysql'); const [credentialsMode, setCredentialsMode] = useState('prompt'); + const [automationMode, setAutomationMode] = useState(false); + const [learnMoreOpen, setLearnMoreOpen] = useState(false); const [token, setToken] = useState(''); const [pmmHost, setPmmHost] = useState(() => window.location.host); const [insecureTLS, setInsecureTLS] = useState(true); @@ -46,6 +60,7 @@ export const InstallClientPage = () => { const [dbName, setDbName] = useState(''); const [dbAuthDB, setDbAuthDB] = useState(''); const [dbServiceName, setDbServiceName] = useState(''); + const [mysqlQuerySource, setMysqlQuerySource] = useState(''); const [copied, setCopied] = useState(false); const [genLoading, setGenLoading] = useState(false); const [genError, setGenError] = useState(null); @@ -58,23 +73,27 @@ export const InstallClientPage = () => { : 0; const isExpired = !!tokenExpiresAt && secondsLeft <= 0; - // Tick once a second while a token is live, so the countdown chip refreshes. - // Stops as soon as expiresAt is null or the token has expired. useEffect(() => { if (!tokenExpiresAt || isExpired) return undefined; const id = window.setInterval(refreshNow, 1000); return () => window.clearInterval(id); }, [tokenExpiresAt, isExpired, refreshNow]); - // When the timer hits zero, drop the secret so the rendered command falls - // back to the placeholder. We deliberately keep `tokenExpiresAt` set so the - // chip can still show "Expired — regenerate" until the user acts. useEffect(() => { if (isExpired && token) { setToken(''); } }, [isExpired, token]); + const suggestedServiceName = useMemo( + () => suggestDbServiceName(technology, dbPort, nodeName), + [technology, dbPort, nodeName] + ); + + const serviceNameHelperText = dbServiceName.trim() + ? 'Passed to the script as --db-service-name.' + : `Leave empty to use the script default (${suggestedServiceName} on the node).`; + const installerUrl = useMemo( () => `${window.location.origin}/pmm-static/install-pmm-client.sh`, [] @@ -107,23 +126,25 @@ export const InstallClientPage = () => { dbName, dbAuthDB, dbServiceName, + dbQuerySource: mysqlQuerySource, }), [ - credentialsMode, - dbAuthDB, - dbHost, - dbName, - dbPassword, - dbPort, - dbServiceName, - dbUser, - insecureTLS, - installerUrl, - nodeAddress, - nodeName, - registerForce, - serverURL, - technology, + credentialsMode, + dbAuthDB, + dbHost, + dbName, + dbPassword, + dbPort, + dbServiceName, + mysqlQuerySource, + dbUser, + insecureTLS, + installerUrl, + nodeAddress, + nodeName, + registerForce, + serverURL, + technology, ] ); @@ -140,8 +161,6 @@ export const InstallClientPage = () => { try { const res = await createNodeInstallToken(technology, 0); setToken(res.token); - // installToken.ts always returns expiresAt; the fallback is just defensive - // belt-and-braces in case of a future refactor. const expires = res.expiresAt ? new Date(res.expiresAt) : new Date(Date.now() + 15 * 60 * 1000); @@ -165,6 +184,19 @@ export const InstallClientPage = () => { [] ); + const handleAutomationModeChange = useCallback( + (e: ChangeEvent) => { + const enabled = e.target.checked; + setAutomationMode(enabled); + if (enabled) { + setCredentialsMode((mode) => (mode === 'prompt' ? 'env' : mode)); + } else { + setCredentialsMode('prompt'); + } + }, + [] + ); + const handlePmmHostChange = useCallback( (e: ChangeEvent) => setPmmHost(e.target.value), [] @@ -210,6 +242,12 @@ export const InstallClientPage = () => { [] ); + const handleMysqlQuerySourceChange = useCallback( + (e: SelectChangeEvent) => + setMysqlQuerySource(e.target.value as MySQLQuerySource), + [] + ); + const handleDbNameChange = useCallback( (e: ChangeEvent) => setDbName(e.target.value), [] @@ -236,60 +274,58 @@ export const InstallClientPage = () => { - - Choose installation options, then copy and run the generated command on your database - node. Include env variables and Pass as script flags use the usual{' '} - curl … | bash form. Prompt on node renders a two-step command - that downloads the script to /tmp/install-pmm-client.sh first, then runs - it with sudo -E bash so it can prompt you for the DB user and password on - the node (or skip prompts if you already exported DB_USER /{' '} - DB_PASSWORD-E keeps them visible to the script). - - Generated tokens are Grafana Admin–role on the minted install service account and valid for 15 minutes{' '} - — treat the URL like a password. + Pick your database type, generate a short-lived token, then copy and run the + command on your database server with sudo. The script installs the + PMM client and adds one monitored service. - - - - Technology - - - - - Credentials mode - - - - In prompt mode the rendered command is a two-liner: curl -o downloads - the script to /tmp/install-pmm-client.sh, then{' '} - sudo -E bash runs it on a TTY so it can ask for the DB user and password, - or use credentials you already exported (DB_USER, DB_PASSWORD, or - per-tech MYSQL_* / …) without prompts. - - - + {learnMoreOpen ? 'Show less' : 'Learn more'} + + + + + + Generated tokens expire in 15 minutes and grant Admin-level + access — treat the command like a password. + + + Multiple instances on one node: run the command again with a + different port. The script skips node registration after the first run. + + + Enable Running in CI/automation? below to embed credentials in + the command (env or flags). For interactive installs, leave it off. + + + Full documentation + + + + + + + Technology + + { label="PMM host" value={pmmHost} onChange={handlePmmHostChange} - helperText="Hostname or hostname:port for PMM_SERVER_URL (defaults to this page if empty)" + helperText="Usually leave as-is (this page's hostname)" /> { helperText={ isExpired ? 'Token expired. Click Regenerate to mint a new one.' - : 'Used only to render command locally in browser. Generated tokens auto-expire 15 min after creation.' + : 'Click Generate below — token is filled in automatically.' } /> + -